Saturday, 31 August 2013

arrays does not null from beginning

arrays does not null from beginning

I'm a beginner in C .... I have a little code:
#include <stdio.h>
#include <string.h>
int main(){
char str1[100];
char str2[100];
char str3[100];
char str4[100];
puts(str1)
puts(str2);
puts(str3);
puts(str4);
return 0;
}
I got result
2
èý(
'Q]wØ„ÃîþÿÿÿÀ"bwd&bw
I don't know why my array does not empty from the begin. And I have to set
first element to "\0" to clear content of array. Can anyone explain for
me. Thank a lot.

No comments:

Post a Comment