counter with specific if statement

Hello Everyone,

How can I make an if statement to do something when 1 has been added to that integer variable. I'm using some variables as my game's win counter. And I want to use an if statement so that in the scenario that 1 has been added to that counter to output something.

Example:
if (1 was added to variable tie) cout << "It's a tie!" << endl;

Thank you
Last edited on
1
2
3
4
5
bool tie=0;
//...
if(...) tie=1;
//...
if(tie) cout << "It's a tie!" << endl;
tie is going to be used as a counter therefore the code above wont work.. tie is going to change each time the cycle of the loop runs.. so i need something that will test if 1 was added to variable tie. tie is going to be used like this tie++. thus i'm looking for something to check if 1 has been added to variable tie.
Something like if(prev_tie + 1 == tie)?
Topic archived. No new replies allowed.