<string.h>
头文件中。void *memmove(void *dest, const void *src, size_t n);
#include <stdio.h> #include <string.h> int main() { char str[] = "Hello, World!"; printf("Original string: %s\n", str); // 将字符串前6个字符移动到字符串的末尾 memmove(str, str + 7, 6); memmove(str + 6, "!", 2); printf("Modified string: %s\n", str); return 0; }输出结果为:
Original string: Hello, World!
Modified string: World!!
本文链接:http://task.lmcjl.com/news/17192.html