I tried the following code:
int a[4] = {0};
int b[4] = {5};
int c[4];
printf("%d %d %d %d %d %d\n", a[0], a[3] , b[0], b[3], c[0], c[3]);
And got the following result:
0 0 5 0 random random
While I get why I got random values for the c
array, I don't understand why the assignation {5}
does not work as {0}
and only initialize the first element of the array.
Is there a way to initialize array b
elements to the same value different from 0? (without using a memset, or a for loop)