strcpy 函数

来源:互联网 发布:网络诈骗去哪里举报 编辑:程序博客网 时间:2024/06/15 06:48
摘自linux内核4.11.1 string.c

author:Linus Torvalds


头文件:#include <string.h>
作用:字符串拷贝函数,将src拷贝至dest
参数:
dest:目标存储区
src:源字符串
返回值:

dest的地址

/** * strcpy - Copy a %NUL terminated string * @dest: Where to copy the string to * @src: Where to copy the string from */char *strcpy(char *dest, const char *src){char *tmp = dest;while ((*dest++ = *src++) != '\0')/* nothing */;return tmp;}


原创粉丝点击