From: | Andrija Antonijevic |
Date: | 26 Aug 99 at 04:02:44 |
Subject: | Re: Array limits? |
From: Andrija Antonijevic <TheAntony2@bigfoot.com>
History books say that Damir Arh spoke these words on 25-Avg-99 AD.
>I just came accross something the other day. I declared a huge array:
>char buffer[50000];
>Everything was fine when I compiled the program, but nasty bugs where
>occuring all the time, particularly Corrupt Memory List. After I reduced
>the buffer to the size of 5000 everything was fine. I'd like to know
>whether there are really any limits to the size of an array.
>BTW, I'm using GCC if that is of any importance.
That array was allocated from stack and you had a stack overflow.
Set stack to a large value and it will work with 50000. Of course,
you probably know that you should dynamically allocate that
kind of arrays, so I won't tell you that ;)
/// /_\ _ _| |_ ___ _ _ _ _ http://www.bigfoot.com/~TheAntony
__ /// / _ \| ' \ _/ _ \ ' \ || | Amiga Translators' Organization
\\\/// /_/ \_\_||_\__\___/_||_\_, | (*Serbian department*)
\XX/ TheAntony@bigfoot.com |__/ Team *AMIGA*
A seminar on Time Travel will be held two weeks ago.