Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!bionet!agate!ucbvax!ucsd!mvb.saic.com!ncr-sd!ncrcae!hubcap!grimlok From: grimlok@hubcap.clemson.edu (Mike Percy) Newsgroups: comp.lang.c Subject: Re: Problems allocating 300k data structure using Turbo C Message-ID: <1991Mar18.185218.28085@hubcap.clemson.edu> Date: 18 Mar 91 18:52:18 GMT References: <1991Mar15.230133.16073@lynx.CS.ORST.EDU> Distribution: usa Organization: Clemson University Lines: 23 Try POINT huge *p; p = farmalloc(300000UL); if(!p) /* error ... */ for(long i = 0; i < 300000L; p[i++] = 0); /* the above might not work, the [] operator may take only ints, I can't remember. If so, the following should work */ for(long i = 0; i < 300000L; *(p + i++) = 0); You can use any model except the tiny model. Check out the section on pointer arithmetic in the Programmer's Guide (p. 57 in my copy). "I don't know about your brain, but mine is really...bossy." Mike Percy grimlok@hubcap.clemson.edu ISD, Clemson University mspercy@clemson.BITNET (803)656-3780 mspercy@clemson.clemson.edu