I can successful declare a dynamic one dimensional array (size is unknown at compilation) but I can't get my program to compile when I try to make it two dimensional. Here is what worked:
header.h
Code:
[snip]
int *myLocations;
main.cpp
Code:
[snip]
routeData myRoute;
myRoute.myLocations = new int[10];
Here is what didn't work:
header.h
Code:
int *myLocations(*);
main.coo
Code:
routeData myRoute;
myRoute.myLocations = new int[10][10];
The 10s are just examples of what may come from what the user specified the array size to be.
Or would it be best to just use a two dimensional vector, since those don't seem to need to have size constraints on them?