|
|
#include <string.h>void *memmove(dest, src, count) void *dest; const void *src; size_t count;
#include <stdio.h> #include <string.h>Using memmove, string Source is copied into string Target. sizeof returns the size of the string, including the end-of-string character, effectively shortening Target.char Source[] = ">>>>>>>>>><<<<<<<<<<"; char Target[] = "Copy the characters in here: " "to see if memmove correctly moves " "in the string"; char *ToPrint;
main() { printf("Target Before: %s\n\n", Target); ToPrint = memmove(&Target[32], Source, sizeof(Source)); printf("Target After: %s\n", Target); }
ANSI X3.159-1989 Programming Language -- C .