If statement help...
I need some help, with 'if statements'. I can't seem to find the right way to explain it...
Like making my application do something if the input is between 2 numbers.
Sorry I couldnt explain very well... Thanks to anyone that can help.
if (lvl > 31)(lvl < 71)
You are just leaving out the "and" operation.
Think about your problem in plain English first:
"I want to do something if lvl is greater than 31 and lvl is less than 71."
Turning that into C++:
Notice the only real difference is the "&&".
if ( (lvl > 31) && (lvl < 71) )
In C++ "&&" means "and". You can use it in "if" statement to do these kind of things.
I think you're looking for:
The "&&" means AND. So if they are both TRUE, the if statement is executed.
if (lvl > 31 && lvl < 71)