What is the integer reference type in C#?

前端 未结 8 1213
日久生厌
日久生厌 2021-01-11 12:46

I\'d like to have an integer variable which can be set to null and don\'t want to have to use the int? myVariable syntax. I tried using int and

8条回答
  •  南笙
    南笙 (楼主)
    2021-01-11 13:13

    Yes, it's the only way, as Int32/Int16/int is a primitive type (regardless of boxing/unboxing of these).

提交回复
热议问题