delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/08/27/08:34:36

From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Newbie: multidimensional arrays problem
Date: 27 Aug 2003 11:34:54 GMT
Organization: Aachen University of Technology (RWTH)
Lines: 20
Message-ID: <bii50u$fsj$1@nets3.rz.RWTH-Aachen.DE>
References: <87752c88 DOT 0308270034 DOT 646465b AT posting DOT google DOT com>
NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 1061984094 16275 137.226.32.75 (27 Aug 2003 11:34:54 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 27 Aug 2003 11:34:54 GMT
Originator: broeker@
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Tom Weston <tomweston_usenet AT yahoo DOT com> wrote:
> I'm quite a novice with c++ so this is probably more a language
> issue than a compiler/system one but I've been writing a program 
> and have just included some multidimensional arrays that make
> for a strange effect that I can't explain.

The problem almost certainly is caused by the exact size of your
arrays.  Make them a little larger, and odds are your program will
crash immediately on startup.  Make them a little smaller and it'll
work fine, or maybe crash later.  Move them outside the main()
function, and the problem will vanish for good.  Replace them by
dynamically allocated arrays (using the 'new' operator), and it'll
vanish, too, but programming becomes a bit more tricky.

Check out the DJGPP FAQ, Q 15.9, "How much stack can I have in DJGPP
programs?", details.

-- 
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019