1

what does the question mark mean at the end of the variable?

TimeSpan? begin = // bla bla bla

The coding language is c#

David Hall
  • 32,624
  • 10
  • 90
  • 127
Shaokan
  • 7,438
  • 15
  • 56
  • 80
  • It´s a nullable type. It is not specific for TimeSpan but can be used on structs and primitive types. See http://msdn.microsoft.com/en-us/library/2cf62fcy(v=vs.80).aspx#Y100 – Lasse Espeholt May 29 '11 at 13:37

2 Answers2

12

This is Nullable type. It means that value of begin can be null or a timespan

TimeSpan? and Nullable<Timespan> is same thing

Stecya
  • 22,896
  • 10
  • 72
  • 102
1

TimeSpan? means you're declaring a nullable type. A type which can support null values.

LeftyX
  • 35,328
  • 21
  • 132
  • 193