Why does printf show different output for 4 different char[] variables if they all have the same value?
Here is my code:
#include <stdio.h>
#define MAX 1000
main()
{
char w[MAX];
char x[MAX];
char y[MAX];
char z[MAX];
printf("w: %s\n", w);
printf("x: %s\n", x);
printf("y: %s\n", y);
printf("z: %s\n", z);
}
Here is the output:
gcc test.c -o test && ./test
test.c:4:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
4 | main()
| ^~~~
w:
x: ��<��
y:
z: S�td