uTools-Manuals/docs/c/stpcpy.html
2019-04-21 11:50:48 +08:00

37 lines
865 B
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h1>字符串函数 - stpcpy</h1>
<p>原型extern char *stpcpy(char *dest,char *src);</p>
<p>用法:#include &lt;string.h></p>
<p>功能把src所指由NULL结束的字符串复制到dest所指的数组中。</p>
<p>说明src和dest所指内存区域不可以重叠且dest必须有足够的空间来容纳src的字符串。</p>
返回指向dest结尾处字符(NULL)的指针。
举例:<pre><code class="language-c">
// stpcpy.c
#include &lt;syslib.h>
#include &lt;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>