D
Dennis
I would like to dynamically allocate in a sub a 2 dimensional Array
float *myarray = new float [n][n];
of course I get an error. How do you allocate a 2D array using the New
operator?
I currently use
static float gxy[10000][10000];
but I don't want my array in the sub to use up my stack space.
Also does the New operator automatically make the values in the array static if
the array pointer is never deleted when the sub is ended? That is I only
allocate the array once the first time I enter the sub. All subsequent sub
calls skip the array allocation section and use the array pointer that was
allocated in the first sub call. The pointer and values in the array are not
touched when the sub ends?
Thanks for any help.
Dennis
float *myarray = new float [n][n];
of course I get an error. How do you allocate a 2D array using the New
operator?
I currently use
static float gxy[10000][10000];
but I don't want my array in the sub to use up my stack space.
Also does the New operator automatically make the values in the array static if
the array pointer is never deleted when the sub is ended? That is I only
allocate the array once the first time I enter the sub. All subsequent sub
calls skip the array allocation section and use the array pointer that was
allocated in the first sub call. The pointer and values in the array are not
touched when the sub ends?
Thanks for any help.
Dennis