Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!uc!nic.MR.NET!hall!walterb From: walterb@hall.cray.com (Walter Boese) Newsgroups: comp.lang.c Subject: Re: HELP needed to declare very large global array Message-ID: <7034@hall.cray.com> Date: 10 Apr 90 15:57:23 GMT References: <18816@oregon.uoregon.edu> Distribution: usa Organization: Cray Research, Inc., Mendota Heights, MN Lines: 36 In article <18816@oregon.uoregon.edu>, MICHELBI@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