Really quick, can someone tell me what the ? operator is?
Thanks,
AnT
Printable View
Really quick, can someone tell me what the ? operator is?
Thanks,
AnT
? isn't an operator. ?: is the ternary operator:Code:int x = 5;
const char *greater = ( x > 4 ? "yes" : "no");
If expr evaluates to true, then the operator resolves as true-result, otherwise false-result.Code:result = ( expr ? true-result : false-result);