I am inheriting some C#/Asp code from a programmer that believes in not comments at all. There are a few functions that have a parameter that is int? and I can't seem to find a reference to this anywhere as to what exactly this means. For example:
Code |
Can anyone tell me what exaclty placing the ? on the int type does?
Thanks,
Rod

Chris Riley33 reputationPosted Aug 9, 2010, 6:02 AM EDT
See http://msdn.microsoft.com/en-us/library/2cf62fcy.aspx
Rod P4 reputationPosted Aug 9, 2010, 6:43 AM EDT
kailash biswal70 reputationPosted Aug 13, 2010, 12:46 AM EDT
Generally we can not assign a null value to a value type, if u asign a null value it's throgh a execption , tto assign a null value to value type we are define ? operator
sham suman11 reputationPosted Aug 16, 2010, 2:46 AM EDT
Here int? is means nullable type.
Nullable types are declared in one of two ways:
1. System.Nullable
-or-
2. T? variable
T is the underlying type of the nullable type.
The reason is int is a value type and null can't be assign into value type because it through exception.