C# 에서 사용되는 데이터 타입
아래 테이블의 Short Name 과 .NET Class 타입 모두 사용가능 하다.
컴파일러는 컴파일시 Short Name 을 .NET Class 로 변환하는 과정을 거치게 된다.
Short Name |
.NET Class |
Type |
Width |
Range (bits) |
byte |
Unsigned integer |
8 |
0 to 255 |
|
sbyte |
Signed integer |
8 |
-128 to 127 |
|
int |
Signed integer |
32 |
-2,147,483,648 to 2,147,483,647 |
|
uint |
Unsigned integer |
32 |
0 to 4294967295 |
|
short |
Signed integer |
16 |
-32,768 to 32,767 |
|
ushort |
Unsigned integer |
16 |
0 to 65535 |
|
long |
Signed integer |
64 |
-9223372036854775808 to 9223372036854775807 |
|
ulong |
Unsigned integer |
64 |
0 to 18446744073709551615 |
|
float |
Single-precision floating point type |
32 |
-3.402823e38 to 3.402823e38 |
|
double |
Double-precision floating point type |
64 |
-1.79769313486232e308 to 1.79769313486232e308 |
|
char |
A single Unicode character |
16 |
Unicode symbols used in text |
|
bool |
Logical Boolean type |
8 |
True or false |
|
object |
Base type of all other types |
|||
string |
A sequence of characters |
|||
decimal |
Precise fractional or integral type that can represent decimal numbers with 29 significant digits |
128 |
±1.0 × 10e−28 to ±7.9 × 10e28 |
출처 : https://msdn.microsoft.com/en-us/library/ms228360(v=vs.90).aspx
'C# > Grammar' 카테고리의 다른 글
Bit Enum (Flag) (0) | 2017.10.01 |
---|