I wanted to initialize all the elements of my integer array to -2.
I have seen various answers that int A[10] = {0}
initializes all 10 elements to 0. But, I couldn't reproduce that with -2.
#include <stdio.h>
int main() {
int A[10] = {-2};
printf("%d",A[3]);
}
gives default 0 instead of -2.
How can I do that. The concerned array size is very big.