C++ 2d array initialization -
the following line doesn't work:
int n1=10,v1=10; int f[n1][v1]={}; error: variable-sized object ‘f’ may not initialized
but line below works, why?
const int n1=10,v1=10; int f[n1][v1]={};
array initializers need const.
an int value can change const int value remain constant throughout entire program.
Comments
Post a Comment