c# - How to create structure with null value support? -


i'm new in c#. in c# can't set value of structure null how can create structure null value support?

structs , value types can made nullable using generic nullable<> class wrap it. instance:

nullable<int> num1 = null; 

c# provides language feature adding question mark after type:

int? num1 = null; 

same should work value type including structs.

msdn explanation: nullable types (c#)


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -