> double variable[1000][1000] = { 0 };
In other words, about 8MB in size.
You're basically blowing away the stack, which depending on your machine could be as little as say 16K in size.
Depending on your compiler, you can specify the initial stack size as being something else.
Since 300*300*8 is about .75 Meg, I'd guess your stack size defaults to 1MB.
1. Make it global - move the array outside of the function it is in.
2. Make it static, as in
static double variable[1000][1000] = { 0 };
3. Allocate it dynamically.
double (*variable)[1000] = new double[1000][1000]; // c++ way
double (*variable)[1000] = malloc ( 1000 * sizeof(*variable) ); // C way
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953