As I understand it, according to the standard, only the first element of the array is filled, and the rest should be filled with zeros.
int ar[10] = {-1}; int ar2[10][10] = {-1,}; Is it possible to somehow set the default value not equal to zero for all elements of the array at the moment of declaration? Maybe there is something in the new standard? Or just a cycle?
int a[](I think in Windows for short) you can get out in crosses int a [5] = {(wmemset ((wchar_t *) a, 1, sizeof (a) / sizeof (a [0])), 1)}; for (int i = 0; i <5; i ++) cout << a [i]; // yes, displays 5 ones - avp