It is often used to eliminate the longer form of if when all you are doing is assigning a value to a variable, as in this case.
Its not a statement, its a conditional expression. Can use anywhere in an expression, very convenient and intuitive but woefully underused because its not taught enough. Many functions return expression can be concisely written with them:
int hexvalue (char c)
{
return (c >= '0' && c <= '9') ? c - '0' :
(c >= 'A' && c <= 'f') ? c - 'A' + 10 :
(c >= 'a' && c <= 'f') ? c - 'a' + 10 :
-1 ;
}