HELP needed to declare very large global array

Walter Boese walterb at hall.cray.com
Wed Apr 11 01:57:23 AEST 1990


In article <18816 at oregon.uoregon.edu>, MICHELBI at oregon.uoregon.edu (Michel Biedermann) writes:
> I am having problems declaring the following array as a global variable
> using QuickC 2.0:
> 
> #define MAX_CHANNELS 6
> #define MAX_SAMPLES 3000
> 
> float data[MAX_CHANNELS][MAX_SAMPLES];
> 
> void main(void)
> {
> /* use data[][] here */
> }
> 
> In the interest of making this a good learning experience, please give me
> both solutions (since my array is > 64K):
> 	1.  Using a small or medium memory model.
> 	2.  Using a huge memory model.
> 

The QC compiler does not handle the huge keyword, this is a CL option
only.  I don't belive that there is a huge model in QC.  I have the full
package - QC and CL compilers.  The CL is an optimizing compiler that can
handle the huge key word as well as huge models.

In the CL compiler you would do the following:
In a small or medium model, declare your data 'float huge data[][]'.
This will work if your data is less than 128k, after that you have to size
your array in powers of 2 or use a huge model.

As for huge model, I believe you don't have to do anything.
I think it should work.


I'm not an expert programmer, but that is how I resolved the problem.
Walter



More information about the Comp.lang.c mailing list