On Wed, 7 Mar 2007 10:51:08 +0000 (GMT)
justin finnerty
#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:
static int l_buffer[BUFFER_SIZE];
This way, l_buffer would be allocated at compile time not run time.
Note that the storage for automatic variables allocated in main()
persist for the duration of the program. As you found out, stack space
can be limited, so if your program counts on unusually large stack
requirements, it may not run on all Unix/Linux platforms.
--
Jerry Feldman