Mail Archives: djgpp/1998/05/17/17:16:25
From: | "John M. Aldrich" <fighteer AT cs DOT com>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Re: New to djgpp, desperate for help...
|
Date: | Sun, 17 May 1998 17:01:37 -0400
|
Organization: | Two pounds of chaos and a pinch of salt.
|
Lines: | 27
|
Message-ID: | <355F5031.1A7C@cs.com>
|
References: | <355F48B9 DOT 8DB27C57 AT cyberrealm DOT net>
|
NNTP-Posting-Host: | ppp144.cs.net
|
Mime-Version: | 1.0
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
The Hodsdons wrote:
>
> Okay, after all that, my simple question is: Why didn't this simple
> program work?
> (I am running it in a Win95 DOS prompt window. I set DPMI to 65535 as
> it
> suggested in the FAQ.)
>
> main() {
> int test[90000];
> printf("This is a test.\n");
> return(0);
> }
The problem here is that you're overflowing the 256K runtime stack
(90000 x 4 = 360000). The DJGPP Frequently Asked Questions list tells
you how to enlarge the stack in chapter 15.9. However, no matter what
compiler you use, it's not really a good idea to allocate large data
structures automatically.
--
---------------------------------------------------------------------
| John M. Aldrich | "A committee is a life form with six |
| aka Fighteer I | or more legs and no brain." |
| mailto:fighteer AT cs DOT com | |
| http://www.cs.com/fighteer | - Lazarus Long |
---------------------------------------------------------------------
- Raw text -