Code: Select all
#include <memory.h>
#include <iostream.h>
void main(){
int a[10];
int i;
int value=0;
memset(a,value,sizeof(a));
for(i=0;i<10;i++)
cout<<a[i]<<' ';
}
but when I change the code to "int value=1;", the output is 16843009 16843009 16843009 16843009 16843009 16843009 16843009 16843009 16843009 16843009.
Why??!! (I use Visual C++ 6.0)