C语言中move语句的用法?说错了,是memmove语句```````````

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/06 07:31:36
C语言中move语句的用法?说错了,是memmove语句```````````
xSn@KJipn6[V H7 $'vŢm BJYT-PL D`%4gq"TDxcsΜ{f&毹]m?-,KXЭcݫnwopM&Ƙ{'!Ӊj>l-+"$BH(Y'aCDNJw J]&0Qn؃o`m]H/Nїϲs:8魄3\ɶ5D=lRc׏ tURV6y@fY5 E5UAXRTIMgz' iȀs~tF^t99W@.+|pRYn\I.3JO11;5td.n[O'"ɞLe#P]I*Rb7$^%3m99F\""xD"iUI>;:&om

C语言中move语句的用法?说错了,是memmove语句```````````
C语言中move语句的用法?
说错了,是memmove语句```````````

C语言中move语句的用法?说错了,是memmove语句```````````
void *memmove( void *dest,const void *src,size_t count );
头文件是
此函数将src后面的count个字符,拷贝到dest中.
举个例子:
char string1[60] = "The quick brown dog jumps over the lazy fox";
char string2[60] = "The quick brown fox jumps over the lazy dog";
/* 1 2 3 4 5
* 12345678901234567890123456789012345678901234567890
*/
memcpy( string1 + 16,string1 + 40,3 );
/*
就是string1数组中第40个字符的后面三个字符,替换string1数组中第16个字符后面的三个字符
*/
printf( "Result:%s\n",string1 );
printf( "Length:%d characters\n\n",strlen( string1 ) );
程序得出的结果为:
Result:The quick brown fox jumps over the lazy fox
Length:43 characters
我尽力讲清楚了,!