In c++, if you do something like:
int array [2][4] =
{
{1,2,3},
{4,5,6,7}
}
Is array [0][3]
null or nonexistent?
In c++, if you do something like:
int array [2][4] =
{
{1,2,3},
{4,5,6,7}
}
Is array [0][3]
null or nonexistent?
It is actually value initialized, so it will be 0
. It is similar to if you had
int values[5] = {1,2};
This would produce the array
{1, 2, 0, 0, 0}
Here is a thorough description of zero-, default-, and value-initialization if you're interested in the definitions and when each applies.