1) In C++, is providing the initializer list {}
the same as {0}
? Will the statements:
int x[10]={};
int x[10]={0};
both produce the same array with all elements initialized to 0?
2) On systems/compilers where NULL
is not 0, do default-value initializations of arrays of pointers set the elements to NULL or to 0? Which of the following statements should/can be used?
int *x[10]={NULL};
int *x[10]={0};
int *x[10]={};
How about new
value-initializers using empty parentheses -- do they use NULL or 0 as the initializer?
int **x=new int*[10]();