char *strcpy(char *dst, const char *src)
{
assert(NULL != src);
assert(NULL != dst);
assert(dst != src);
char *cp = dst;
while ('/0' != (*cp++ = *src++)) ;
return dst;
}
参考文章
http://dev.csdn.net/develop/article/17/17569.shtm
http://dev.csdn.net/develop/article/16/16680.shtm
博客给出了strcpy函数的代码实现,通过断言确保源指针和目标指针不为空且不相等,然后将源字符串内容复制到目标字符串,最后返回目标指针,还提供了参考文章链接。

3182

被折叠的 条评论
为什么被折叠?



