memmove


memmove

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.

Example

 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( )



C(c) In a Nutshell
C in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596006977
EAN: 2147483647
Year: 2006
Pages: 473

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net