I have big matrices like 600*600 and larger in my code. I'm trying to estimate a parameter and the solution is iterative. so I have to do lots of matrix multiplication in my code. When the size of my matrices become bigger than 600*600, I GET an stack overflow error. I don't know how I have to solve this issue. I read somewhere that I have to use NEW to allocate array on heap. Does anyone know how I have to do this? Or any other solution for my problem.
If you need to see my code, I can email it to you.
constunsignedint vSize = 600*600;
// instead of this
int iVec[vSize];
// do this
int *iVec = newint[vSize];
// and remember to delete [] iVec when you're done with it
Thanks for your reply.
I didn't used something like: int iVec[vSize];
I always use malloc to define and allocate memory for my variable.
I'm a little confused. for example, if I defined and initialized a matrix like this: