Aug 15, 2014 at 5:15pm UTC
Line 59, you're missing a } to terminate the checkDraw function.
The }; at line 60 terminates your class.
Your use of indentation and alignment of {} is very inconsistent. A consistent style of matching { with } should have made a missing } easy to spot.
Aug 15, 2014 at 6:16pm UTC
What exactly doesn't work?
I played one game and it appeared to work.
Aug 15, 2014 at 6:22pm UTC
I have Visual Studio 2010 and it will not start.I have errors like:
1> Add directive to 'StdAfx.h' or rebuild precompiled header
1>c:\users\pc\documents\visual studio 2010\projects\pajdicka\pajdicka\tictactoe.cpp(2): warning C4627: '#include <string>': skipped when looking for precompiled header use
1> Add directive to 'StdAfx.h' or rebuild precompiled header
1>c:\users\pc\documents\visual studio 2010\projects\pajdicka\pajdicka\tictactoe.cpp(24): error C2065: 'cout' : undeclared identifier
1>c:\users\pc\documents\visual studio 2010\projects\pajdicka\pajdicka\tictactoe.cpp(25): error C2065: 'cout' : undeclared identifier
1>c:\users\pc\documents\visual studio 2010\projects\pajdicka\pajdicka\tictactoe.cpp(25): error C2065: 'endl' : undeclared identifier
1>c:\users\pc\documents\visual studio 2010\projects\pajdicka\pajdicka\tictactoe.cpp(26): error C2065: 'cout' : undeclared identifier
1>c:\users\pc\documents\visual studio 2010\projects\pajdicka\pajdicka\tictactoe.cpp(36): error C2065: 'cout' : undeclared identifier
1>c:\users\pc\documents\visual studio 2010\projects\pajdicka\pajdicka\tictactoe.cpp(44): error C2065: 'cout' : undeclared identifier
1>c:\users\pc\documents\visual studio 2010\projects\pajdicka\pajdicka\tictactoe.cpp(58): error C2065: 'cout' : undeclared identifier
1>c:\users\pc\documents\visual studio 2010\projects\pajdicka\pajdicka\tictactoe.cpp(75): error C2065: 'cout' : undeclared identifier
1>c:\users\pc\documents\visual studio 2010\projects\pajdicka\pajdicka\tictactoe.cpp(76): error C2065: 'cin' : undeclared identifier
1>c:\users\pc\documents\visual studio 2010\projects\pajdicka\pajdicka\tictactoe.cpp(77): error C2065: 'cout' : undeclared identifier
1>c:\users\pc\documents\visual studio 2010\projects\pajdicka\pajdicka\tictactoe.cpp(80): error C2065: 'cout' : undeclared identifier
1>c:\users\pc\documents\visual studio 2010\projects\pajdicka\pajdicka\tictactoe.cpp(90): error C3861: 'system': identifier not found
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:01.81
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Aug 15, 2014 at 6:37pm UTC
1> Add directive to 'StdAfx.h' or rebuild precompiled header
You have
precompiled headers enabled. You can either disable them or
#include "stdafx.h"
Actually on your second set of code you added the header. Though it needs to be first as it is
precompiled . So put it on line one.
Last edited on Aug 15, 2014 at 6:38pm UTC
Aug 15, 2014 at 7:32pm UTC
how to play?
I can run the program, but how to play the game?
Aug 15, 2014 at 7:36pm UTC
You enter a number from 1-9. Anyways the op should change it so that when it is a "wrong move" it doesn't change player.
Aug 15, 2014 at 7:49pm UTC
Thanks. It works now. I can play the game now.