Why is there a questionmark on the private variable definition?

c#, nullable

Solution

It's a nullable value. Structs, by default, cannot be nullable, they must have a value, so in C# 2.0, the `Nullable<T>` type was introduced to the .NET Framework.

C# implements the `Nullable<T>` type with a piece of syntactic sugar, which places a question mark after the type name, thus making the previously non-nullable type, nullable.

Problem

I am reading an article about the MVVP Pattern and how to implement it with WPF. In the source code there are multiple lines where I cannot figure out what the question marks in it stand for. ``` private DateTime? _value; ``` What does the `?` mean in the definition? I tried to find it in the help from VS but failed.

Original source