C# using the question mark after a type, for example: int? myVariable; what is this used for?

Posted by GenEric35 on Stack Overflow See other posts from Stack Overflow or by GenEric35
Published on 2010-04-22T12:52:36Z Indexed on 2010/04/22 12:53 UTC
Read the original article Hit count: 331

Filed under:
|
|

Hi, typically the main use of the question mark is for the conditional, x ? "yes" : "no".

But I have seen another use for it but can't find an explanation of this use of the ? operator, for example.

public int? myProperty { get; set; }

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET