I need to declare a dynamically allocated 2 dimensional array, in a header, without knowing its dimensions, which will be established inside a function.
In the header I want to place:
#define MAX_BARS_ALLOWED 20000
extern int Gregorian[][MAX_LINES_ALLOWED]; //it works
and in the .cpp
file, inside a function:
int **Gregorian=new int*[NumLastItem+1][MAX_LINES_ALLOWED]; //this does NOT work, why ?
... and since I initialize it inside a function, will it be really global.
Can anyone teach me the correct way to do this ? Thank you in advance !!