Search code examples
c#.net.net-3.5nullable

What does ?? mean in C#?


Possible Duplicate:
What do two question marks together mean in C#?

What does the ?? mean in this C# statement?

int availableUnits = unitsInStock ?? 0;

Solution

  • if (unitsInStock != null)
        availableUnits = unitsInStock;
    else
        availableUnits = 0;