mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2026-05-15 09:58:45 +08:00
37 lines
865 B
HTML
37 lines
865 B
HTML
<h1>字符串函数 - stpcpy</h1>
|
|
|
|
|
|
<p>原型:extern char *stpcpy(char *dest,char *src);</p>
|
|
|
|
<p>用法:#include <string.h></p>
|
|
|
|
<p>功能:把src所指由NULL结束的字符串复制到dest所指的数组中。</p>
|
|
|
|
<p>说明:src和dest所指内存区域不可以重叠且dest必须有足够的空间来容纳src的字符串。</p>
|
|
返回指向dest结尾处字符(NULL)的指针。
|
|
|
|
举例:<pre><code class="language-c">
|
|
|
|
|
|
// stpcpy.c
|
|
|
|
#include <syslib.h>
|
|
#include <string.h>
|
|
|
|
main()
|
|
{
|
|
char *s="Golden Global View";
|
|
char d[20];
|
|
|
|
clrscr();
|
|
|
|
stpcpy(d,s);
|
|
printf("%s",d);
|
|
|
|
getchar();
|
|
return 0;
|
|
}
|
|
|
|
</code></pre>相关函数:<a href="strcpy.html">strcpy</a>
|
|
|