X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Hans-Bernhard Broeker Newsgroups: comp.os.msdos.djgpp Subject: Re: Trouble of using very large arrays Date: 22 Apr 2004 12:35:44 GMT Lines: 20 Message-ID: References: NNTP-Posting-Host: ac3b07.physik.rwth-aachen.de (137.226.33.205) X-Trace: news.uni-berlin.de 1082637344 9651034 D 137.226.33.205 ([231750] 10357) X-Orig-Path: not-for-mail To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Mok-Kong 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. You don't provide all the necessary details for anyone to be sure, but this very strongly feels like you're blowing the stack. Don't make large variables like this automatic (i.e. local to some function). The usual recommended solution is to use the heap instead of the stack, i.e. use 'new' or malloc(), depending on what language you're working in, or make such variables static. -- Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.