(四)strcpy实现(拷贝字符串) strcpy的实现需要注意如下几点: 1、输入指针合法性检查 2、目标字符串和源字符串是否相同 3、复制规则 //拷贝指定的字符串
基于124个网页-相关网页
These functions include strcpy(3), strcat(3), sprintf(3) (with cousin vsprintf(3)), and gets(3).
这些函数包括 strcpy(3)、strcat(3)、sprintf(3) (及其同类 vsprintf(3) )和 gets(3) 。
You also have to use the memalign function and strcpy to copy the data into an area of appropriate alignment.
另外,还需要使用 memalign 函数和 strcpy 将数据复制到合适对齐的区域。
The correct way to do this would be to use the strncpy function instead of strcpy , and give the maximum number of bytes to copy as BUFSIZ - 1.
复制的正确方法是用strncpy函数代替strcpy,并将要复制的最大字节数定为BUFSIZ - 1。
应用推荐