So, I see that the practice for dynamic allocating of an array of pointers looks like this:
int **array = new int *[10];
And indeed, using syntax:
int *array[] = new int *[10];
results in error:
/Users/Malachi/Projects/playground/playground.gcc/src/pgccc-5/main.cpp:8: error: definition of variable with array type needs an explicit size or an initializer
const char* test_array[];
^
I'm always more comfortable using pure pointer syntax anyway. However, what bothers me is lines like this:
int main(int argc, char *argv[])
are valid. I'm accustom to empty array brackets [] more or less aliasing out to a pointer type. It seems to me char *argv[] is subject to almost exactly the same constraints as my int *array[], so why is the syntax permitted in one scenario but not the other?
EDIT: It appears the simpler case of int array[] = new int[10] exhibits the same behavior
new T[]returns aT *