/ Published in: C#
If you set the int keyword to be Nullable, then when x is declared there it's set to null.
On the second line, the "??" are saying if x is null then assign -1 instead.
On the second line, the "??" are saying if x is null then assign -1 instead.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Nullable<int> x; int y = x ?? -1;