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

36 lines
899 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>字符串函数 - memcpy</h1>
<p>原型extern void *memcpy(void *dest, void *src, unsigned int count);</p>
<p>用法:#include &lt;string.h></p>
<p>功能由src所指内存区域复制count个字节到dest所指内存区域。</p>
<p>说明src和dest所指内存区域不能重叠函数返回指向dest的指针。</p>
举例:<pre><code class="language-c">
// memcpy.c
#include &lt;syslib.h>
#include &lt;string.h>
main()
{
char *s="Golden Global View";
char d[20];
clrscr();
memcpy(d,s,strlen(s));
d[strlen(s)]=0;
printf("%s",d);
getchar();
return 0;
}
</code></pre>相关函数:<a href="memccpy.html">memccpy</a>,<a href="memmove.html">memmove</a>,<a href="strcpy.html">strcpy</a>