delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/23/04:00:24

From: "A. Sinan Unur" <sinan DOT unur AT cornell DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: use memory more than 1MB
Date: Thu, 22 Jan 1998 21:15:29 -0500
Organization: Cornell University (http://www.cornell.edu/)
Lines: 31
Sender: asu1 AT cornell DOT edu (Verified)
Message-ID: <34C7FD41.68CCEAD0@cornell.edu>
References: <01bd26e6$b95daea0$0100007f AT localhost>
NNTP-Posting-Host: cu-dialup-0021.cit.cornell.edu
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

VAMPYR wrote:
> 
> How to make DJGPP use memory more than 1MB(or more)?
> 
> This is my test file:
> ===========================
> void main()

FYI, it is supposed to be int main(void)

> {
>   char array[1024000];
> }

the default stack size is 256K. if you allocate the array globally
instead of locally, or if you use malloc, you won't have a problem:

  char *array = malloc[32*1024*1024];

> ===========================
> I compiled with "gcc test.c -o test.exe" , but it appears error!
> How should I do?

-- 
----------------------------------------------------------------------
A. Sinan Unur
Department of Policy Analysis and Management, College of Human Ecology,
Cornell University, Ithaca, NY 14853, USA

mailto:sinan DOT unur AT cornell DOT edu
http://www.people.cornell.edu/pages/asu1/

- Raw text -


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