Newsgroups: comp.os.msdos.programmer Path: utzoo!utgpu!cunews!ajai From: ajai@sce.carleton.ca (Ajai Sehgal) Subject: Huge Arrays in Turbo C++ Message-ID: Sender: news@ccs.carleton.ca (news) Organization: Carleton University, Ottawa, Canada Distribution: comp Date: 13 Sep 90 13:17:37 GMT As a follow up to my last question, after further experimentation I discovered that if two separate arrays are declared as huge with exactly the same number of elements, they are assigned the same start address and become essentially the same array with different names. If I alter the size of the second array by even one element, the two arrays are completely different and held in different memory locations. This seems to me to be a compiler bug, one that the latest Borland patch doesn't take care of. example: float huge array[1024][1024]; float huge array2[1025][1024]; ^^^^^ works just fine , array and array2 are refer to different memory locations. example2: float huge array[1024][1024]; float huge array2[1024][1024]; does not work , array2 is effectively a copy of array and any values written to array also appear in the same locations in array2. Note: the above problem does not appear to happen if the array size is smaller than 512 x 512. The second discovery I made is that huge arrays work just fine when declared within a function as a local. When I tried to declare them as Globals outside of Main() the program compiled just fine but hung the system half way through the linking process. (work just fine not including the problem describedabove). Being new to C , and C++ the above strikes me as being odd. Has anyone out there experienced similar problems, if not , what am I doing wrong? Borland's manuals are less than clear and the latest books on C++ don't help either. Any help would be greatly appreciated. Regards, Ajai. (ajai@sce.carleton.ca)