1. Value Type (integer, floating point, and decimal)
| Type |
Alias |
Category |
Valid digits |
Suffix |
Allowed value |
| Sbyte |
System. sbyte
|
Signed byte type |
8-digit |
None |
100 |
| Byte |
System. byte |
Unsigned byte type |
8-digit |
None |
100 |
| Short |
System. int16 |
Signed short integer |
16-bit |
None |
100 |
| Ushort |
System. uint16 |
Unsigned short integer |
16-bit |
None |
100 |
| Int |
System. int32 |
Signed integer |
32-bit |
None |
100 |
| Uint |
System. uint32 |
Unsigned integer |
32-bit |
None, u, u |
100u |
| Long |
System. int64 |
Signed long integer type |
64-bit |
None, l, l |
100l |
| Ulong |
System. uint64 |
Unsigned long integer |
64-bit |
None, UL, Lu |
100ul |
| Char |
System. Char |
Unsigned character type |
16-bit |
None |
'A' |
| Float |
System. Single |
Single precision floating point type |
32-bit (precision 7-bit) |
F, F |
3.14f |
| Double |
System. Double |
Dual-precision floating point |
64-bit (accuracy: 15 to 16) |
None, D, |
3.1415 |
| Decimal |
System. Decimal |
Floating Point Type |
128 bits (precision: 28 to 29 BITs) |
M, m
|
3.14 m |
Note: a) the character U represents unsigned;
B) float and double representation: +/-M * 2 to the power of E;
C) decimal representation: +/-M * 10 to the power of E;
D) The values of M and E are determined by type;
2. bool type
Alias: system. boolean. The allowed values are true and false. Example: bool bcount = true;
3. string type
Alias: system. String. The string type is the reference type. There is no upper limit on the characters that make up the string. It is a variable-size memory.
Example: String strcount = "Hello world! ";
This article from the "action is better than words" blog, please be sure to keep this source http://vikxiao.blog.51cto.com/9189404/1549659
Step by Step C # language [data type]