Confused by these errors

This is a discussion on Confused by these errors within the C++ Programming forums, part of the General Programming Boards category; Code: int main() { PlayingArea Board; Player PlayerA("X"); Player PlayerB("O"); bool SYNC = true; int Square; do{ Board.ClearBoard(); do{ cout<<"Player ...

  1. #1
    Programmer Frantic-'s Avatar
    Join Date
    Dec 2004
    Posts
    114

    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?

  2. #2
    Anti-Poster
    Join Date
    Feb 2002
    Posts
    1,399
    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);
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

  3. #3
    Programmer Frantic-'s Avatar
    Join Date
    Dec 2004
    Posts
    114
    ahh i feel so dumb now :-/ ty very much

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Header File Errors...
    By Junior89 in forum C++ Programming
    Replies: 5
    Last Post: 07-08-2007, 01:28 AM
  2. Sneaky little linker errors...
    By Tozar in forum C++ Programming
    Replies: 8
    Last Post: 10-25-2006, 06:40 AM
  3. Errors when including winsock2.h
    By skiingwiz in forum Windows Programming
    Replies: 2
    Last Post: 12-27-2002, 07:32 PM
  4. executing errors
    By s0ul2squeeze in forum C++ Programming
    Replies: 3
    Last Post: 03-26-2002, 01:43 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21