字符串函数

来源:互联网 发布:sharpdesk软件 编辑:程序博客网 时间:2024/04/30 11:46

strcpy

原型:extern char *strcpy(char *dest,char *src);

用法:#include <string.h>

功能:把src所指由NUL结束的字符串复制到dest所指的数组中。

返回指向dest结尾处字符(NUL)的指针。

举例:

// strcpy.c

#include <syslib.h>

#include <string.h>

main()

{

char *s="Golden Global View";

char d[20];

clrscr();

strcpy(d,s);

printf("%s",d);

getchar();

return 0;

}

0 0