memmove

Buffer Manipulation Functions

Moves a number of bytes from one buffer to another.

void *memmove( void *dest, const void *src, size_t n ); 

destDestination buffer where the data is copied.
srcThe name of the source buffer from which the data is copied.
nThe number of bytes to copy.

Return Values

Returns dest, the destination buffer to where the data is copied.

Example

The following example moves the first 4 characters 1 space forward. Because the first character, `a', remains unchanged, "abcde" becomes "aabcd".

     #include <string.h>
     char buffer[80];
     strcpy( buffer, "abcde");
     memmove(buffer+1, buffer, 4 );
     lr_output_message ("New string: %s\n", buffer);
Example: Output:
New string: aabcd