delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/08/02:36:48

From: "A. Sinan Unur" <asu1 AT cornell DOT edu>
Newsgroups: comp.os.msdos.djgpp,comp.lang.c,rec.games.programmer
Subject: Re: segmentation fault...
Date: Thu, 07 Aug 1997 23:53:38 -0400
Organization: Cornell University http://www.cornell.edu
Lines: 27
Sender: asu1 AT cornell DOT edu (Verified)
Message-ID: <33EA9842.5653@cornell.edu>
References: <33E99579 DOT 8B2 AT gapeach DOT com>
Reply-To: asu1 AT cornell DOT edu
NNTP-Posting-Host: cu-dialup-0028.cit.cornell.edu
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Jacob Martin wrote:

> BUT, If I keep my 2D and add a 1D.....
> 
> int map[100][255],map[25500];

is this global or local? my guess is local. basically, you are
allocating 204,000 bytes out of 256 K of default stack space. hence,
combined with the rest of your code, this is causing you to run out of
stack space.

it would be better to allocate such large arrays on the heap rather than
on the heap, although you can use stubedit to increase the default stack
size of your program.

btw, a variable definition by itself without any context is really not
much info to go by. i find reading code easier than debugger output.

-- 
   Sinan
 
*******************************************************************
 A. Sinan Unur                                WWWWWW
                                              |--O+O
 mailto:sinan DOT unur AT cornell DOT edu                C   ^ 
 http://www.people.cornell.edu/pages/asu1/     \  ~/ 
*******************************************************************

- Raw text -


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