www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/04/25/12:25:32

Xref: news2.mv.net comp.os.msdos.djgpp:3106
From: Thomas Demmer <demmer AT LSTM DOT Ruhr-UNI-Bochum DOT De>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: problem with DJGPP and arrays.
Date: Thu, 25 Apr 1996 15:32:16 +0100
Organization: Lehrstuhl fuer Stroemungsmechanik
Lines: 49
Message-ID: <317F8CF0.167E@LSTM.Ruhr-UNI-Bochum.De>
References: <4lk5mk$rl4 AT news DOT nevada DOT edu>
NNTP-Posting-Host: bvb.lstm.ruhr-uni-bochum.de
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

GEORGE GAGHON wrote:
[...]
> I have the arrays inited like so:
> 
> int array1[20000], array2[10000], array3[70000] ...
> ...
> int array7[5300], array8[1200] ...
> ...
> int array 12[70000]
> 
> When I try to binary load using _open or fopen, when I get to array7[]
> I get an traceback error like so...
> 
> fread+66
> load_save+54  line xxxx of name.c
> main+199      line xxx of name.c
> cntr_???+115  I am assuming that this program calls 'main'
Your problem is not the fopen() but fread(). Would be nice to 
know with which message the program crashes. 



> 
> If I put a dummy array in like: 
> int array_dummy[5300], array7[5300], array8[1200]...
> then it works ok.
> So far all the other arrays I have tested work fine when loading a binary
> file into it.  I looked in the FAQ and found nothing that helped.

Given you defined the arrays as automatic variables, they go onto the stack. 
The stack is limited to 256kB by default. From the little info you provide
I _guess_ this is the problem. See the FAQ on how to increase the stack space
or make the arrays non-automatic.
-- 
Ciao
Tom



*************************************************************
* Thomas Demmer                                             *
* Lehrstuhl fuer Stroemungsmechanik                         *
* Ruhr-Uni-Bochum                                           *
* Universitaetsstr. 150                                     *
* D-44780  Bochum                                           *
* Tel: +49 234 700 6434                                     *
* Fax: +49 234 709 4162                                     *
* http://www.lstm.ruhr-uni-bochum.de/~demmer                *
*************************************************************

- Raw text -


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