Previous Page
Next Page


Copies the contents of a memory block

#include <string.h>
void *memmove ( void *dest , const void *src , size_t int n  );

The memmove( ) function copies n successive bytes beginning at the address in src to the location beginning at the address in dest. The return value is the same as the first argument, dest. If the source and destination blocks overlap, copying takes place as if through a temporary buffer, so that after the function call, each original value from the src block appears in dest.


char a[30] = "That's not what I said." ;

memmove( a+7, a+11, 13 );      // Move 13 bytes, 'w' through '\0'
puts( a );

These lines produce the following output:

That's what I said.

See Also

memcpy( ), wmemmove( )

Previous Page
Next Page