doubel a[100] = {0, 1}

is there any standard that I can rely on about how the rest of array members would be initialized in initializations like
double a[100] = {0, 1}
or
double a[100] = {1}

on my compiler the rest of the array members are initialized to zero (which is my desired behaviour) but I am concerned about portability of this,

thanks
That is standard behavior.
1
2
3
4
5
6
7

double myArray[10]={};


output 
0 0 0 0 0 0 0 0 0 0 


If the array is uninitialized all the member will be 0.
Topic archived. No new replies allowed.