mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-12-17 00:04:34 +08:00
0.0.1
This commit is contained in:
32
docs/c/strcpy.html
Normal file
32
docs/c/strcpy.html
Normal file
@@ -0,0 +1,32 @@
|
||||
<h1>字符串函数 - strcpy</h1>
|
||||
|
||||
<p>原型:extern char *strcpy(char *dest,char *src);</p>
|
||||
<p>用法:#include <string.h></p>
|
||||
<p>功能:把src所指由NULL结束的字符串复制到dest所指的数组中。</p>
|
||||
<p>说明:src和dest所指内存区域不可以重叠且dest必须有足够的空间来容纳src的字符串。
|
||||
返回指向dest的指针。</p>
|
||||
|
||||
举例:
|
||||
|
||||
<pre>
|
||||
// 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;
|
||||
}
|
||||
</pre>
|
||||
相关函数:<a href="memccpy.html">memccpy</a>,<a href="memcpy.html">memcpy</a>,<a href="stpcpy.html">stpcpy</a>,<a href="strdup.html">strdup</a>
|
||||
|
||||
Reference in New Issue
Block a user