I've been recently working on a Tic Tac Toe game for my C++ class. As I was working on the "winner" part of the game, I thought that I could use a strcmp to compare my arrays like:
**NOT MY ACTUAL CODE**
Code:
char board[10][10]; // lets just assume all the data is already in here
char winner[10][10] =
{
"X", "", "",
"", "X" ,""
"", "", "X"
};
if (strcmp(board, winner) == 0)
{
cout << "You Win!";
}
It didn't work.
Is there a way to compare two arrays, or should i just use a strcmp(board[0],board[1])==0...?
Thanks in advance
-Matt