X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Subject: RE: Trouble of using very large arrays Date: Thu, 22 Apr 2004 17:21:39 -0400 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Trouble of using very large arrays Thread-Index: AcQor8rHn1S2NxtLTEq7aE76sMGMjQ== From: "John Bond" To: Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id i3MLLlJl026550 Reply-To: djgpp AT delorie DOT com ******M. K. Shen wrote: I have difficulty in using very large arrays. In a simple program I could have 'unsigned int a[70000][2]' without problem but with 'unsigned int a[80000][2]' the program aborts without even the code being changed to access the increased new part of the array. Why is this so? Thanks in advance. ****** Looks like you over-ran your stack. Look at FAQ 6.6 to expand the stack with the global _stklen. When I had this problem, I added the line: unsigned _stklen = 1048576; /* need a 1MB stack */ to double the stack size. If you know your local variable size needed (in bytes), this is useful. Otherwise use the heap. -JBond, jbond_at_ai-logix.com (replace _at_ with @)