《Linux函数调用手册》之___strncpy拷贝字符串
定义:
char * strncpy(char *dest,const char *src,size_t n);
表头文件:
#include <string.h>
说明:
strncpy()会将参数src字符串拷贝前n个字符至参数dest所指的地址。
返回值:
返回参数dest的字符串起始地址。
相关函数:
bcopy, memccpy, memcpy, memmove
示例:
执行:
before strncpy() : string(1)
after strncpy() : string(1)
返回顶部 | 《Linux函数调用大全》 | 《Linux命令大全》 | Linux专栏