Date: Sun, 9 Feb 2003 12:26:59 -0500 Message-Id: <200302091726.h19HQxp16523@envy.delorie.com> X-Authentication-Warning: envy.delorie.com: dj set sender to dj AT delorie DOT com using -f From: DJ Delorie To: djgpp AT delorie DOT com In-reply-to: (luckie@netvigator.com) Subject: Re: allocating big chunks with djgpp References: Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > with 16-bit DOS compilers, char buffer[30000][81] seems unrealistic and > infeasible. Now with Djgpp, how do I allocate such a big buffer in terms of > what syntax is used? or leave that code snippet intact and the linker will > function okay? Yeah, that syntax "just works" with djgpp. Note, however, that there is still a limit to stack space, so if you try to create a buffer like that as a local variable (i.e. inside a function) you'll have problems. If you need a local-scope variable, at least make it static, or use malloc/free. ok: char buffer[30000][81]; int foo() { static char buffer[30000][81]; char **buffer2 = malloc(30000 * 81); } bad: int foo() { char buffer[30000][81]; } If needed, however, you can use djgpp's stubedit to increase the size of the stack to 3mb or more for that particular buffer.