vaj4088:
It is sometimes called the Elvis operator, and the colon is part of it.a?b:c ;
basically means,
If a is true then the result is b, otherwise the result is c.
?: is a ternary operator (meaning that it takes three operands), possibly the only one in C/C++.Why is it called the Elvis operator? Because if you look at it sideways and squint a lot, you may see Elvis Presley.
Thanks- I couldn't remember the name of the operator..
Thanks, also to Vaj. I knew it was a valid operator- I just couldn't remember the name to verify my suspicion of how it works.