www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/18/06:07:42

Message-ID: <33EC3E5A.5A6C@gapeach.com>
Date: Sat, 09 Aug 1997 05:54:34 -0400
From: Jacob Martin <jake AT gapeach DOT com>
Reply-To: jake AT gapeach DOT com
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp,comp.lang.c,rec.games.programmer
Subject: Re: segmentation fault...
References: <33E99579 DOT 8B2 AT gapeach DOT com> <33EA9842 DOT 5653 AT cornell DOT edu>
NNTP-Posting-Host: ip209.iainc.net
Lines: 38
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

A. Sinan Unur wrote:
> 
> 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.
>
You were exactly right, my stack was too small...
 
> it would be better to allocate such large arrays on the heap rather than
> on the heap, 

On the heap, but not on the heap...

now I'm confused...
How does one allocate a variable on the heap...?
(what is a 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.
> 
> --
I had already gone through the code a million times...I knew it had to
be with the array (since when I took it out it worked) I just didn't
know why...That's why  I didn't post my code...

(besides, it's long)

Jake ...

- Raw text -


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