您的位置:首页 > 产品设计 > UI/UE

Default Values Table (C# Reference)

2016-06-27 00:00 591 查看
默认值表(C# 参考)
https://msdn.microsoft.com/zh-cn/library/83fhsxwc(v=vs.120).aspx

The following table shows the default values of value types returned by the default constructors. Default constructors are invoked by using the new operator, as follows:

int myInt = new int();

The preceding statement has the same effect as the following statement:

int myInt = 0;

Remember that using uninitialized variables in C# is not allowed.

下表中有以下几点需要注意:

bool类型的默认值为false;

结构体中各字段的默认值由其类型确定,所有引用类型的默认值为null,而不是c++中的NULL



内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: