C++ if problems

#include<iostream>
#include<string>

using namespace std;

int main()
{
string input;
int money = 0;
int game = 1;

while(game = 1)
{
cin >> input;

if(input == "help")
{
cout << "Type St00fs f0r St00fs t0 happen\n";

}
if(input == "awsome")
{
cout <<"You Stumble along the dirt road and find a penny\n";

money = money + 1;

}
if(input == "money")
{
cout <<"You has " << money << " mooneys\n";

}
if(input == "gameover")
{
cout <<"You die guiz guiz\n";
game = 0;
}


}

return 0;
}

I cant figure out how to get the program to end i type the gameover command making the game = 0 and when game = 0 its not 1 so why doesnt program end
while(game = 1) should be while(game == 1)

~psault
Topic archived. No new replies allowed.