怎么在VC++中置空一个数组
<FONT color=#0000ff>我定义了一个字符数组 char a[100],我用了一个函数cin.getline(a,sizeof(a))获取a<BR>现在我又想把数组a置空 请问需要用到什么函数或用什么方法?如果用到库函数请把头文件给我</FONT><BR><P><BR> // memset.c<BR> <BR> #include <syslib.h><BR> #include <string.h></P>
<P> main()<BR> {<BR> char *s="Golden Global View";<BR> <BR> clrscr();<BR> <BR> memset(s,'G',6);<BR> printf("%s",s);</P>
<P> getchar();<BR> return 0;<BR> }<BR> <BR><BR></P> <P>可以用专门的API<BR>VOID ZeroMemory(</P>
<P> PVOID Destination, // address of block to fill with zeros <BR> DWORD Length // size, in bytes, of block to fill with zeros <BR> );</P>
页:
[1]
