It's simple. Just break them into segments.
hour < 10 ? "0" : " "
The hour <10 part tells that if value of hour is less than 10 then 0 will be displayed, if hour is not less than 10 then it displays nothing.
If the condition is satisfied then the expression following ? is done if the condition is not satisfied then the expression after : is done.
It is a conditional statement of the form [(boolean expression evaluation) ? (execution in case of true) : (execution in case of false)].Much like an if else statement.In this particular case if (hour<10) will evaluate to true a "0" will be inserted first in the cout stream and a "" otherwise.