C#中怎样将double变量置空
2个回答
展开全部
double ? n = null;
数据类型一定要是可空的double, 请参阅:
[vb.net 代码]
Dim n As Double?
n = 6.88D
MessageBox.Show(n)
n = Nothing
If n Is Nothing Then MessageBox.Show("n is nothing")
[c#.net 代码]
double? n;
n=6.88d;
MessageBox.Show(n);
n = null;
if (null = n)
MessageBox.Show("n is nothing");
数据类型一定要是可空的double, 请参阅:
[vb.net 代码]
Dim n As Double?
n = 6.88D
MessageBox.Show(n)
n = Nothing
If n Is Nothing Then MessageBox.Show("n is nothing")
[c#.net 代码]
double? n;
n=6.88d;
MessageBox.Show(n);
n = null;
if (null = n)
MessageBox.Show("n is nothing");
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询