uTools-Manuals/docs/c/bzero.html

42 lines
814 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>字符串函数 - bzero</h1>
<p>原型extern void bzero(void *s, int n);</p>
<p>用法:#include &lt;string.h></p>
<p>功能置字节字符串s的前n个字节为零。</p>
<p>说明bzero无返回值。</p>
举例:<pre><code class="language-c">
// bzero.c
#include &lt;syslib.h>
#include &lt;string.h>
main()
{
struct
{
int a;
char s[5];
float f;
} tt;
char s[20];
bzero(&tt,sizeof(tt)); // struct initialization to zero
bzero(s,20);
clrscr();
printf("Initail Success");
getchar();
return 0;
}
</code></pre>相关函数:<a href="bcmp.html">bcmp</a>,<a href="bcopy.html">bcopy</a>