-
Confused by these errors
Code:
int main()
{
PlayingArea Board;
Player PlayerA("X");
Player PlayerB("O");
bool SYNC = true;
int Square;
do{
Board.ClearBoard();
do{
cout<<"Player One, which sqaure would you like to take?\nSqaure:";
cin>>Sqaure;
Board.SetSquare(Square,PlayerA.Symbol());
}
SYNC=false;
}while(SYNC == true);
return(0);
}
--------------------Configuration: TicTacToe - Win32 Debug--------------------
Compiling...
Source.cpp
C:\Documents and Settings\Owner\Desktop\Comp Prog\C++\Sams C++\Lesson 10\TicTacToe\Source.cpp(239) : error C2065: 'Sqaure' : undeclared identifier
C:\Documents and Settings\Owner\Desktop\Comp Prog\C++\Sams C++\Lesson 10\TicTacToe\Source.cpp(243) : error C2061: syntax error : identifier 'SYNC'
Error executing cl.exe.
TicTacToe.exe - 2 error(s), 0 warning(s)
I declared both variables at the top!! Why is it saying this?
-
Heh...spell check.
Code:
int Square;
//snip
cin>>Sqaure;
The second error is because you're missing a while.
Code:
do{
Board.ClearBoard();
do{
//snip
} //umm...while?
SYNC=false;
}while(SYNC == true);
-
ahh i feel so dumb now :-/ ty very much