I have been reading about headers but i am not understanding it when it comes to arrays. Of course i am doing it wrong but what is the best way or am i just messing something. row and column undeclared identifier how do i properly pass an array to a header file
in my main.cpp i have it initialed like this:
const int row = 3;
const int column = 3;
char position[row][column];
a sample input when accessing the class is
TTT play;
play.display(position)
Remember that array indexes start at ZERO, not at 1.
So accessing position[3][3] in your function is out of bounds if the array is only of size [3][3].
Apart from that I don't see anything wrong with the code (although the class is kind of meaningless.... your 'display' behaves more like a global function).
EDIT:
Actually... lack of 'row' and 'column' being defined might be a problem. You might have to move those definitions to the header file.
thank you i got it now i have a new problem gonna work on it before i post another question. I was using the array positions at [0] for something else but i changed so i don't confuse myself later on