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:
Remember that using uninitialized variables in C# is not allowed.
下表中有以下几点需要注意:
bool类型的默认值为false;
结构体中各字段的默认值由其类型确定,所有引用类型的默认值为null,而不是c++中的NULL
![](https://oscdn.geek-share.com/Uploads/Images/Content/202001/22/6f0e59aacbb1de686282bcfeef32c54b.png)
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
![](https://oscdn.geek-share.com/Uploads/Images/Content/202001/22/6f0e59aacbb1de686282bcfeef32c54b.png)
相关文章推荐
- heap with priority queues
- soapui笔记12:PropertyTransfer
- soapui笔记11:Propertis
- UITextField
- Non-Mathematical Feature Engineering techniques for Data Science
- EasyUI模糊查询
- Druid数据库连接池及内置监控的配置和使用
- 334. Increasing Triplet Subsequence
- 232. Implement Queue using Stacks
- openwrt build for asus rt-n13u b1
- Distinct Subsequences
- (2016.12.02更新)CnCrypt文件保险柜1.18,兼容TrueCrypt加密卷,单文件绿色版
- 屏幕适配二 Values 适配
- AJAX POST请求中参数以form data和request payload形式在servlet中的获取方式
- 如何修改分享菜单的背景图片以及调用无UI方法自定义UI分享
- php-resque的设计和使用
- 225. Implement Stack using Queues
- UISegmentedControl
- 95. Unique Binary Search Trees II
- leetcode-java-347. Top K Frequent Elements