Tag Archives: memset

memset,memcpy,strcpy

strcpy

char *strcpy( char *dest, const char *src );

dest-pointer to the byte string to copy to
src-pointer to the null-terminated byte string to copy from

Copies the byte string pointed to by src to byte string pointed to by dest.If the strings overlap, the behavior is undefined.

ps.src和dest所指内存区域不可以重叠且dest必须有足够的空间来容纳src的字符串,返回指向dest的指针。strcpy 就只能拷贝字符串,它遇到’\0’就结束拷贝,不会拷贝’\0’。例如: Continue reading