#include <string.h>
void *memmove(void *dest, const void *src, size_t n);
#include <stdio.h>
#include <string.h>
int main()
{
char src[] = "hello linux world";
char *p = src + 6;
int n = strlen(p);
printf ("%s\n", p);
memmove(src, p, n);
src[n] = '\0';
printf ("%s\n", src);
return 0;
}
./memmove
linux world
linux world
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |