From: "A. Sinan Unur" Newsgroups: comp.os.msdos.djgpp Subject: Re: "big" arrays Date: Mon, 29 Dec 1997 00:55:23 -0500 Organization: Cornell University (http://www.cornell.edu/) Lines: 22 Sender: asu1 AT cornell DOT edu (Verified) Message-ID: <34A73B4B.A430C820@cornell.edu> References: <01bd13ea$293d4c40$a8dcc7c7 AT suzie> NNTP-Posting-Host: cu-dialup-0084.cit.cornell.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk mephisto wrote: > > When you have a line like this "char MyArray[20000000];", DJGPP will > attempt to allocate the array, but if you use implicit allocation(ie, > not using malloc or an equilavent) DJGPP won't make your program > crash. So, use malloc and test the results. i have no idea what you mean here, but the difference is whether the array is global or allocated on the stack. the default stack size for djgpp programs is 256Kb, so a local array larger than that will corrupt the stack, leading to a crash. you can either increase the size of the stack, or, better IMO, allocate such a large amount of memory dynamically. -- ---------------------------------------------------------------------- A. Sinan Unur Department of Policy Analysis and Management, College of Human Ecology, Cornell University, Ithaca, NY 14853, USA mailto:sinan DOT unur AT cornell DOT edu http://www.people.cornell.edu/pages/asu1/