On Wednesday 07 March 2007 09:11, Jerry Feldman wrote:
On Wed, 7 Mar 2007 10:51:08 +0000 (GMT)
justin finnerty <linuxchem@yahoo.com.au> wrote:
#ifndef BUFFER_SIZE #define BUFFER_SIZE 16*1024 #endif
int main (int argc , char** argv) { int l_buffer[BUFFER_SIZE];
Just a couple of additional issues since this is a stack overflow problem. You've got a 16MB buffer size allocated in main(). You would be better off declaring the buffer as static:
As was already suggested.
static int l_buffer[BUFFER_SIZE];
This way, l_buffer would be allocated at compile time not run time.
The space required would be recorded in the object file, but unless there's an initializer present, the space implied by the declaration would not be occupied in the object file. The allocation would occur only when setting up the BSS area (uninitialized data) during execution (i.e., the exec(2) system call) of the program..
...
Randall Schulz --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org