c# - What does a ? do in a new Type?[5] assignment? -


this question has answer here:

i have following piece of code, , have no idea ? means in construct.

what doing?

myobj_request r = new myobj_request(); //instantiate intial object r.channels = new channelsequence();    //initial object has object in channels r.channels.channeltype = new channeltype?[5] { .. } // ok have 5 channeltypes...                                                     //  ? infront of [5] ? 

it's nullable type. difference?

int c = 5; // can set numbers  int? d = null; // can set int or null int? e = 5; 

int? basically exactly equal nullable<int>.

here's reference: msdn

[edit]

so new channeltype?[5] array (5 elements) of nullable<channeltype>.


Comments