摘要:
数值型(Numeric)数据的类型转换,对任何程序语言来说,都是基本功能,C# 也不例外。C# 的类型转换有两种基本形式:隐式(implicit)和显式(explicit),如下例:int x = 345;long y = x;short z = (short)x;其中,y = x,即将整型 x 转换为长整型 y,称为 隐式类型转换,即由编译器自动完成类型转换。因为编译器知道,整型数转换为长整型数,不会有任何精度损失。z = (short)x,即将整型 x 转换为 短整型 z,称为 显式类型转换,即需要程序员明确指出转换的目的类型。因为编译器知道,整型转换为短整型,可能会产生精度损失,所以不能 阅读全文
posted @ 2012-12-01 03:30
野峰-WildPeak
阅读(713)
评论(0)
推荐(0)
摘要:
这本书的作者是兄弟俩,哥哥 Joseph 是鼎鼎大名的LINQPad 的作者,弟弟是前微软公司的 Program Manager。本书涵盖了 C# 5.0 的最新特性,厚达 1064 页!亚马逊上评为 5 颗星。编者写的介绍中,有这样一句话:Shaped by more than 20 expert reviewers, including Microsoft’s Eric Lippert, Stephen Toub, Chris Burrows, and Jon Skeet, this book has all you need to stay on track with C# 5.0. . 阅读全文
posted @ 2012-12-01 03:29
野峰-WildPeak
阅读(315)
评论(0)
推荐(0)