什么是“Int?”在C#中 [英] What is "Int?" in C#

查看:117
本文介绍了什么是“Int?”在C#中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一周前我遇到了一段代码,里面写着



int?



这意味着什么?



先谢谢

解决方案

Nullable< int>

Ref: http://msdn.microsoft.com/en-us/library/1t3y8s4s(v = vs.80).aspx [ ^ ]


要添加对Prera​​k的回答。参考:可空类型(C#编程指南) [ ^ ]


我们可以有小数吗?数据类型?

A week ago i came across a piece of code where it was written

"int?"

what does it means?

Thanks in Advance

解决方案

It is Nullable<int>
Ref: http://msdn.microsoft.com/en-us/library/1t3y8s4s(v=vs.80).aspx[^]


To add to Prerak's answer. Reference: Nullable Types (C# Programming Guide)[^]


can we have decimal? datatype?


这篇关于什么是“Int?”在C#中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆