Hi people,

I am writing a code to do some matrix manipulation stuff.
like replication of a matrix in a bigger matrix vertically and horizontally, or putting some elements on a specific diagonal.

The problem is that when the size of 2-D array goes to 290, the program crashes. The code is compiled but when I try to run it...ooops!
It says:

Unhandled exception at 0x63340a97 in FirstRun.exe: 0xC00000FD: Stack overflow.

I am using Visual C++ 2008 Express edition (which is a free compiler).

This is the declaration in my code:

const int G=290;
const int L=3;
float ReplicatedMat[G+1][L];

Is this problem because of the size of the array?
Program works correctly when G=280...
What do you suggest me to do?!

WaltP commented: Wow!! CODE Tags on the first post -- Thank you!! +9

Recommended Answers

All 4 Replies

My guess, since you didn't post any actual code, is you're reaching G>291 and/or L>2

But the codes works properly when G=280 and l=3...

But the codes works properly when G=280 and l=3...

Since you are unwilling to post any code, I guess that you have this

const int G=290;
const int L=3;
float ReplicatedMat[G+1][L];

inside a recursive function eventually causing the stack overflow.

[EDIT]
Perhaps run the program in the debugger and at the point of the stack overflow, view the Call Stack. That might tell you something useful.

The code is a little big and it's hard to post a little of it on here...
I will do the checking and come back...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.