The new ?? and ??? operators

Janice Caron caron800 at googlemail.com
Mon Sep 24 13:23:05 PDT 2007


On 9/24/07, Rioshin an'Harthen <rharth75 at hotmail.com> wrote:
> I can't begin to count how many times I've written code like
>
>     long id = data.GetLong("ID") ?? 0;

Please could you explain what that does, as I don't speak C# and can't
make any sense of it. What is the return type of GetLong()? What is
the type of the variable named data?


>     long? id = data.GetLong("ID");

What does the question mark after long mean? What is the type of the
variable named id? Is is "long" or "long?" ?



More information about the Digitalmars-d mailing list