Okay I have to make this TicTacToe program. Everything works except my constructor(whi ch must initialize my empty board to all zeros) This is where I run into problems. For some reason my constructor won't do anything. Everything looks right, so I don't know what to do. Here's a snipit of my code.
Thanks
Code:
class TicTacToe { public: TicTacToe(); int checkWinner(); void printBoard(); void playGame(); private: char board[3][3]; bool winner; int row, column, turn; }; int main() { TicTacToe game; game.playGame(); } TicTacToe::TicTacToe() { for(int index = 0; index < 3; index++) { for(int index2 = 0; index2 < 3; index2++) { board[index][index2] = 0; } } }
Comment