Hi I'm new to c++ but I'm basically trying to access a 2D char array in my code, but it always exits the program when it gets to this point. I have no error messages at all, I don't understand it.
DECLARED IN HEADER FILE
private:
char myArray[50][50];
CODE IN SOURCE FILE METHOD FOR SAME CLASS
int i, j;
for (i=0; i<50; i++)
{
cout << "debugging: confirm this stage reached ok";
for (j=0; j<50; j++) cout << "array char:" << myArray[2][2] << endl; //always exits at this point! (cout is used for debugging)
...
}
note this array was initialised in the class constructor:
int i, j;
for (i = 0; i < 50; i++)
for (j = 0; j < 50; j++)
myArray[i][j] = ' ';
Help to understand why this happens would be appreciated.