2002/3/4 struct のところで解説したように、Reference Type と Value Type
があるので、この違いを正しく理解しておかないと、あれっ?ということになる。
|
Types |
| Reference types |
reference types | class |
| interface |
| delegate |
|
built-in reference types | object |
| string |
| Value types | value types | Struct type | struct |
| Enumeration type | enum |
| built-in simple
value types | Numeric types | Integral
types |
|
Floating-point types |
| decimal |
| Boolean type | bool |
| Pointer Type | これはあまり使わないでしょう。 | | |
| Type |
Range |
Size |
| Integral types |
sbyte | -128 to 127 | Signed 8-bit integer |
|
byte | 0 to 255 | Unsigned 8-bit integer |
|
char | U+0000 to U+ffff | Unicode 16-bit character |
|
short | -32,768 to 32,767 | Signed 16-bit integer |
|
ushort | 0 to 65,535 | Unsigned 16-bit integer |
|
int | -2,147,483,648 to 2,147,483,647 | Signed 32-bit integer |
|
uint | 0 to 4,294,967,295 | Unsigned 32-bit integer |
|
long | -9,223,372,036,854,775,808 to
9,223,372,036,854,775,807 | Signed 64-bit integer |
|
ulong | 0 to 18,446,744,073,709,551,615 | Unsigned 64-bit integer |
| Floating-point types |
float | ±1.5 × 10-45 to ±3.4 × 1038
(Approximate range) | Precision 7 digits |
|
double | ±5.0 × 10-324 to ±1.7 × 10308
(Approximate range) | Precision 15-16 digits |
|
|