How can i get 0 as integer value from (int)null.
(int)null
EDIT 1: I want to create a function that will return me default values for null representa
Use null-coalescing operator or ??
??
Example:
int? a = null; return a ?? 0; //this will return 0
It's a new feature in C#. It returns the left-hand operand if the operand is not null; otherwise, it returns the right-hand operand.