Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!texbell!letni!void!ozdaltx!doug From: doug@ozdaltx.UUCP (Doug Matlock) Newsgroups: comp.lang.c Subject: Re: Turbo C large character array Keywords: TC, char, array, large, huge Message-ID: <6819@ozdaltx.UUCP> Date: 30 Jul 90 16:17:53 GMT References: <1990Jul27.193520.4689@ux1.cso.uiuc.edu> Distribution: comp Organization: AIDS INFO EXCG/OZ BBS - Dallas, TX Lines: 33 In article <1990Jul27.193520.4689@ux1.cso.uiuc.edu>, gordon@osiris.cso.uiuc.edu (John Gordon) writes: > > Hello. I am having a problem, and I hope someone can help me. > > I am trying to declare a char array that is rather large, and TCC > won't accept it, it says it is too large to fit within available memory. > By my calculations, this shoud be equal to 96K worth. I am using > the Huge model, which specifically says that arrays of more than 64K may be > used. Not quite. The huge model "permits static data to total more than 64K. it must still be less than 64K in *each* module". (pg 199 in the "new" manuals TC++). If all you need is a very large array, and you always plan to access its elements through a pair of indicies, I suggest you use the tack taken in "Numerical Recipes in C". A character "array" is defined as char **x; and allocated on the heap as x = (char **)malloc(num_rows*sizeof(char)); for (i=0; i