Hi i have c++ as a class and decided to do a tic-tac-toe for fun at home. Um I've only been in it for a week. anyways here is the coding so far:
#include <iostream.h>
#include <string.h>
#include <math.h>
#include <iomanip.h>
#include <conio.h>
#include <stdio.h>
main()
{
char a1='-';
char a2='-';
char a3='-';
char c1='-';
char c2='-';
char c3='-';
char b1='-';
char b2='-';
char b3='-';
char plmove1[3];
char plmove2;
cout << " 1 2 3"<<endl;
cout << "a "<<a1<<" "<<a2<<" "<<a3<<endl;
cout << "b "<<b1<<" "<<b2<<" "<<b3<<endl;
cout << "c "<<c1<<" "<<c2<<" "<<c3<<endl;
cout << endl << endl<< "player 1's turn"<<endl;
cout << "________" << endl;
cout << "you are: x" <<endl;
cout << "make your move: ";
cin.getline(plmove1, 3);
cout << plmove1;
if (plmove1=="a1")
char a1='x';
system("cls");
cout << " 1 2 3"<<endl;
cout << "a "<<a1<<" "<<a2<<" "<<a3<<endl;
cout << "b "<<b1<<" "<<b2<<" "<<b3<<endl;
cout << "c "<<c1<<" "<<c2<<" "<<c3<<endl;
cout << endl << endl<< "player 2's turn"<<endl;
cout << "________" << endl;
cout << "you are: o" <<endl;
cout << "make your move: ";
cin >> plmove2;
system ("pause");
return 0;
}
well the only problem i want to deal with right now is the fact that variable a1 wont equal 'x'. it stays equal to '-' please help. this is not visual c++, it is c++ using dev-c++. thanks a bunch!