相关疑难解决方法(0)

c#为什么不能将nullable int赋值为null

解释为什么无法为int赋值null,例如

int? accom = (accomStr == "noval" ? null  : Convert.ToInt32(accomStr));
Run Code Online (Sandbox Code Playgroud)

这段代码出了什么问题?

c# nullable

125
推荐指数
3
解决办法
12万
查看次数

标签 统计

c# ×1

nullable ×1