0

I have the code snippet below that I think makes an array of double and a variable of type double.

I do not understand what the ? is doing.

double? [] precips = 
{
  tblswatwaprecipitation.January,
  tblswatwaprecipitation.February,
  tblswatwaprecipitation.March,
  tblswatwaprecipitation.April,
  tblswatwaprecipitation.May,
  tblswatwaprecipitation.June,
  tblswatwaprecipitation.July,
  tblswatwaprecipitation.August,
  tblswatwaprecipitation.September,
  tblswatwaprecipitation.October,
  tblswatwaprecipitation.November,
  tblswatwaprecipitation.December
};

double? precipTotal = null;
RobM
  • 747
  • 5
  • 12
  • 3
    It's not an operator in this case - it's part of the type name. Basically it's equivalent to `Nullable[] precips` and `Nullable precipTotal`. See https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/nullable-value-types – Jon Skeet Aug 08 '21 at 06:14
  • Does this answer your question [What is nullable type in c#?](https://stackoverflow.com/questions/13238059/) and [Coding practices for C# Nullable type](https://stackoverflow.com/questions/1550909/) and [What Is The Point of Value on Nullable Types In C#](https://stackoverflow.com/questions/47422370/) and [Why shouldn't I always use nullable types](https://stackoverflow.com/questions/830592/) and [Are null references really a bad thing?](https://softwareengineering.stackexchange.com/questions/12777/) –  Aug 08 '21 at 06:15

0 Answers0