delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/12/17/06:32:45

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
Lines: 29
X-Admin: news AT aol DOT com
From: sterten AT aol DOT com (Sterten)
Newsgroups: comp.os.msdos.djgpp
Date: 17 Dec 2003 11:17:05 GMT
Organization: AOL Bertelsmann Online GmbH & Co. KG http://www.germany.aol.com
Subject: re:allocate memory
Message-ID: <20031217061705.15599.00001193@mb-m03.aol.com>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

> I want to use big global arrays but don't know how.

In djgpp, big global arrays are no different than little global
arrays.  Just declare them.


  #include <stdio.h>

  int foo[100000000];

  main()
  {
  }

The only time you have to be careful is when you put them on the stack
(i.e. local arrays) as there's a limited (but configurable) amount of
stack space.


--------------------------------

there are two disadvantages though:

1.  it takes longer to compile such programs
2.  the executable is very big.


I think, it should be possible to do it without these disadvantages ?!

- Raw text -


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