What's the difference between 'int?' and 'int' in C#?
I am 90% sure I saw this answer on stackoverflow before, in fact I had never seen the "int?" syntax before seeing it here, but no matter how I search I can't find the previous post, and it's driving me crazy.
It's possible that I've been eating the funny mushrooms by accident, but if I'm not, can someone please point out the previous post if they can find it or re-explain it? My stackoverflow search-fu is apparently too low....
int? is shorthand for Nullable<int>
.
This may be the post you were looking for.
int? is Nullable.
MSDN: Using Nullable Types (C# Programming Guide)
int? is the same thing as Nullable. It allows you to have "null" values in your int.
链接地址: http://www.djcxy.com/p/40230.html上一篇: C函数语法,参数列表后声明的参数类型