FelB FelB - 4 months ago 13
C++ Question

What is "int * a[][10];"?

The question is in the title:

What is

int * a[][10];

Is it an array of pointers to arrays of int? I tried to youse the clockwise/spiral rule but I am not sure...

int * a[][10];

is an illegal declaration in C++, as the storage size isn't known. You need to initialize it with arrays of 10 pointers to int, like so:

int* a[][10] = {{nullptr}}; // initialize with one array, the latter consisting of null pointers

or, even simpler,

int* a[][10] = {{}};

Once initialized, it becomes an array of arrays-10 of pointers to int.