Topic: Declare and use a global dynamic array
Author: tchang@aisun4.ai.uga.edu (Tony Chang [MS AI])
Date: 17 Feb 1994 09:01:34 GMT Raw View
How can I declare and use a GLOBAL DYNAMIC ARRAY ????
I am using BC++ v3.1 and the following is what I did; but seems like the
contents of it lost somewhere ......
MAIN_1.CPP
myDataType *array1, *array2;
....
....
array1 = new myDataType huge[1000];
array2 = new myDataType huge[1000];
...etc
SUB_1.CPP
extern myDataType *array1, *array2;
function xxx(....)
array1.a[1] = ....
array1.a[2] = ....
Anyone can tell me what is wrong with this or lead me to the right directions?
Thanks,
Tony