If you are relatively new to C # and you are looking over some code, you may have encounterd questions marks in your code that you do not know what to make of.
string strTime; int intHour; intHour = 12; strTime = intHour > 11 ? 'After Noon' : 'Morning' ;
The combined use of the question mark and colon above act like an if / else statement. The correct term to describe this is TERNARY OPERATOR.
What happens is the following. The variable strTime will hold one of the following values “Afternoon” or “Morning”. How do you know, well it depends on it’s evaluation of the integer variable intHour. The expression says, if (?) intHour is greater than 11 then display “After Noon” else (:) display “Morning”.
Hope that helps someone.