04.04.2010, 19:13
I never knew how to do it, but I know what's for, and what it means. ? is Conditional operator it's used in c++ also. The Conditional operator returns the value in any number or bool you would like. It's formated like this:
A example of this is.
edit: This is what the PAWN manual says, maybe this can help
Код:
YourStatement ? option1 : option2
Код:
if(2+2==4) ? true : false; // I think that's how you do it
Quote:
Originally Posted by Manual
In a case statement and in expressions in the conditional operator
(“ ? : ”), any expression that has a tag override should be enclosed between parentheses, to avoid the colon to be misinterpreted as a separator of the case statement or as part of the conditional operator. |