Initialising a nullable

Download c# eBook

Example

For null values:

Nullable<int> i = null;

Or:

int? i = null;

Or:

var i = (int?)null;

For non-null values:

Nullable<int> i = 0;

Or:

int? i = 0;

Stats

Contributors: 4
2016-07-23
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook