Is this an if else statement

c#, if-statement

Solution

It's called the null-coalescing operator.

If the value to the left of the `??` is `null`, then use the value to the right of the `??` otherwise use the left hand value.

Expanded out:

y = x == null ? 5 : x

or

if(x == null)
     y = 5
else
     y = x

Problem

Possible Duplicate: What do two question marks together mean in C#? I just came across the code below and not really sure what it means and can't google it because google omits the `??` ``` int? x = 32; int y = x ?? 5; ``` Is the second line some sort of if else statement, what does the `??` mean

Original source

Related problems