i want to make a matrix of around 1000 by 1000 but i cannot do it by the conventional 2d array method. i get an error of "stack overflow". kindly tell me how to make the matrix.
thanx
i want to make a matrix of around 1000 by 1000 but i cannot do it by the conventional 2d array method. i get an error of "stack overflow". kindly tell me how to make the matrix.
thanx
If you don't have a 4MB stack, then you can use new. If the 1000 is fixed, then you can do something like:
Code:typedef int row[1000]; // row now means "an array of 1000 ints" row *array; array = new int[1000][1000]; //or new row[1000];
Last edited by tabstop; 05-05-2010 at 11:30 AM. Reason: FIXED bad code