What does double? mean in C# ?

Posted by Nikhil on Stack Overflow See other posts from Stack Overflow or by Nikhil
Published on 2010-06-07T10:00:35Z Indexed on 2010/06/07 10:12 UTC
Read the original article Hit count: 556

Filed under:

Hi, While reading the code of the NUnit project's assert class, I came across this particular construct -

public static void AreEqual(double expected, double? actual, double delta)
{
     AssertDoublesAreEqual(expected, (double)actual, delta ,null, null);
}

In this function the second input parameter is entered as "double?". The interesting thing is that this code compiles without issue in VS2010 (c# 4.0). Anyone know why this is NOT throwing an error ? Why is "double?" considered a valid keyword and is there any special significance to the "?".

© Stack Overflow or respective owner

Related posts about c#