惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

K
Kaspersky official blog
Martin Fowler
Martin Fowler
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
V
Visual Studio Blog
博客园_首页
Engineering at Meta
Engineering at Meta
The Cloudflare Blog
MongoDB | Blog
MongoDB | Blog
Blog — PlanetScale
Blog — PlanetScale
T
The Blog of Author Tim Ferriss
雷峰网
雷峰网
D
Docker
博客园 - 司徒正美
S
SegmentFault 最新的问题
M
MIT News - Artificial intelligence
博客园 - 叶小钗
博客园 - 三生石上(FineUI控件)
U
Unit 42
J
Java Code Geeks
A
About on SuperTechFans
N
Netflix TechBlog - Medium
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
S
Security Affairs
I
Intezer
Cisco Talos Blog
Cisco Talos Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
B
Blog RSS Feed
P
Privacy & Cybersecurity Law Blog
T
Tenable Blog
T
Threatpost
H
Hacker News: Front Page
G
Google Developers Blog
博客园 - 【当耐特】
Hugging Face - Blog
Hugging Face - Blog
Apple Machine Learning Research
Apple Machine Learning Research
L
Lohrmann on Cybersecurity
大猫的无限游戏
大猫的无限游戏
Google DeepMind News
Google DeepMind News
A
Arctic Wolf
S
Secure Thoughts
GbyAI
GbyAI
NISL@THU
NISL@THU
S
Security @ Cisco Blogs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Webroot Blog
Webroot Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
O
OpenAI News
Spread Privacy
Spread Privacy
Application and Cybersecurity Blog
Application and Cybersecurity Blog

博客园 - 吴博

快速了解集群和双机热备相关知识 Could not find stored procedure 'sp_MSins_tablename' Javascript 判断 object 的特定类 当 ASP.NET 在 IIS 6.0 中锁死的情况下,如何生成转储文件 通往 WinDbg 的捷径 请教:在一个在方法段的异常处理里面,如何获取当前方法输入的所有参数值。 性能测试VS负载测试VS压力测试 Silverlight为什么不支持中文?有没有别的途径可以解决这个问题呢? 焦油坑与激情 sqlserver白皮书里的秘密 没有virtual的方法子类是否可以重写? 用记事本可以查看dll文件的release或debug依赖。 VC++.NET 2005 几个比较难缠的问题及其解决方法(转) [zt]关于Debug和Release之本质区别的讨论 vc++,不知道是不是bug。 MSMQ之确认消息 乱解 Overried与new 分区表的经典比喻
C#类型 参考表(MSDN)
吴博 · 2008-12-27 · via 博客园 - 吴博

Posted on 2008-12-27 20:48  吴博  阅读(540)  评论()    收藏  举报

http://www.cnblogs.com/scottckt/archive/2008/01/07/1028745.html

值类型表

值类型 类别

bool

布尔型

byte

无符号、数值、整数

char

无符号、数值、整数

decimal

数值、十进制

double

数值、浮点

enum

枚举

float

数值、浮点

int

有符号、数值、整数

long

有符号、数值、整数

sbyte

有符号、数值、整数

short

有符号、数值、整数

struct

用户定义的结构

uint

无符号、数值、整数

ulong

无符号、数值、整数

ushort

无符号、数值、整数

整型表

类型 范围 大小

sbyte

-128 到 127

有符号 8 位整数

byte

0 到 255

无符号 8 位整数

char

U+0000 到 U+ffff

16 位 Unicode 字符

short

-32,768 到 32,767

有符号 16 位整数

ushort

0 到 65,535

无符号 16 位整数

int

-2,147,483,648 到 2,147,483,647

有符号 32 位整数

uint

0 到 4,294,967,295

无符号 32 位整数

long

-9,223,372,036,854,775,808 到 9,223,372,036,854,775,807

有符号 64 位整数

ulong

0 到 18,446,744,073,709,551,615

无符号 64 位整数

浮点型表

类型 大致范围 精度

float

±1.5e−45 到 ±3.4e38

7 位

double

±5.0e−324 到 ±1.7e308

15 到 16 位

内置类型表

C# 类型 .NET Framework 类型

bool

System.Boolean

byte

System.Byte

sbyte

System.SByte

char

System.Char

decimal

System.Decimal

double

System.Double

float

System.Single

int

System.Int32

uint

System.UInt32

long

System.Int64

ulong

System.UInt64

object

System.Object

short

System.Int16

ushort

System.UInt16

string

System.String

    备注
       除了 objectstring 外,表中的所有类型均称为简单类型。

默认值表

值类型 默认值

bool

false

byte

0

char

'"0'

decimal

0.0M

double

0.0D

enum

表达式 (E)0 产生的值,其中 E 为 enum 标识符。

float

0.0F

int

0

long

0L

sbyte

0

short

0

struct

将所有的值类型字段设置为默认值并将所有的引用类型字段设置为 null 时产生的值。

uint

0

ulong

0

ushort

0


隐式数值转换表

sbyte

shortintlongfloatdoubledecimal

byte

shortushortintuintlongulongfloatdoubledecimal

short

intlongfloatdoubledecimal

ushort

intuintlongulongfloatdoubledecimal

int

longfloatdoubledecimal

uint

longulongfloatdoubledecimal

long

floatdoubledecimal

char

ushortint uint longulong floatdoubledecimal

float

double

ulong

float doubledecimal

  备注
     从 intuintlongfloat 的转换以及从 longdouble 的转换的精度可能会降低,但数值大小不受影响。
     不存在到 char 类型的隐式转换。
     不存在浮点型与 decimal 类型之间的隐式转换。
     int 类型的常数表达式可转换为 sbytebyteshortushortuintulong,前提是常数表达式的值处于目标类型的范围之内。

显式数值转换表

sbyte

byteushortuintulongchar

byte

Sbyte 或者 char

short

sbyte byte ushort uint ulongchar

ushort

sbyte byte shortchar

int

sbyte byte short ushort uint ulongdecimal

decimal

sbyte byte short ushort int uint long ulong char floatdouble