no match for 'operator=='

I watched WarGames and decided to make a WarGames WOPR program.
I stumbled into a roadblock... Dev-C++ gives a "no match for 'operator==' " error when I compile it.
I am not really a n00b, but i'm not an expert either.
HELP ME! I want my WOPR program!
This is the source code:

#include <iostream>
using namespace std;

int main()
{
cout << " Enter password: ";
string pass;
cin>>pass;
cin.ignore();
system("CLS");
cout << " Greetings Professer Falcon.";
string greet;
cin >> greet;
cout << "\n Shall we play a game <Y/N>?";
string answer;
cin >> answer;
char response;
cin >> response;
if (response == 'N'||response == 'n')
{
system("CLS");
cout << " Goodbye Professer Falken.";
cout << "\n ";
system ("PAUSE");
}
else
{
cout << "\n Chess, Tic Tac Toe, Thermonuclear War END OF LIST";
string game1;
cin >> game1;
if (game1 == 'G')
{
system("CLS");
cout << " United States \n";
cout << " Soviet Union \n";
cout << "\n Which side are you on? <U/S>?";
char side;
cin >> side;
if (side == 'U'||side == 'u');
{
system("CLS");
cout << " Do you want to bomb the Soviets?";
cout << "\n Y for yes and N for no";
char bomb;
cin >> bomb;
if (bomb == 'y'||bomb == 'Y')
{
cout << "\n Firing.";
cin.get();
cout << ".";
cin.get();
cout << ".";
cin.get();
cout << " Done";
cout << "\n BOOM!";
}
if (bomb == 'n'||bomb == 'n');
{
system ("CLS");
cout << " The United States has been bombed";
}
if (side == 'S'||side == 's')
{
system("CLS");
cout << " Do you want to bomb the United States?";
cout << "\n Y for yes and N for no";
char bomb;
cin >> bomb;
if (bomb == 'y'||bomb == 'Y')
{
cout << "\n Firing.";
cin.get();
cout << ".";
cin.get();
cout << ".";
cin.get();
cout << " Done";
cout << "\n BOOM!";
}
if (bomb == 'n'||bomb == 'n');
{
system ("CLS");
cout << " The Soviet Union has been bombed";
}
if (game1 == 't'||game1 == 'T')
{
system ("CLS");
cout << " Tic Tac Toe is BORING!";
cin.get();
cout << "\n Goodbye Professor Falken.";
}
if (game1 == 'c'||game1 == 'C')
{
system ("CLS");
cout << " Chess is BORING!";
cin.get();
cout << "\n Goodbye Professor Falken.";
}
}
}
}
}
}
1
2
3
4
5

string game1;
cin >> game1;
if (game1 == 'G')


std::string does'nt overload operator==

try
char game1;
instead of
string game1;

Do'nt forget to use

[code][/code]


for your code
Thanks Machtl! How stupid of me to type string instead of char! Now I can play Thermonuclear War...
Topic archived. No new replies allowed.