OC: Basic data type number of words 450 read 881 comments 2 likes 5 basic type type qualifier modifier
In addition to the basic types, there are some types of qualifier modifiers
- Short shorter type, modified int, double;
- Long, modified int, double;
- Signed is a symbolic type, modified int, char;
- Unsigned unsigned type, modified int, char;
1. These qualifiers are often used to qualify int, which can be omitted when the int type is qualified;
2.short and long will change the length of the int, the length of different compilers is not the same, but the general short length is not much longer than int,int length;
3.signed and unsigned do not change the type length, only indicates whether the highest level is a sign bit, where unsigned represents a positive number greater than or equal to 0;
Range of values
In order to be able to find and use the data type correctly in future development, the following is the value range of some data types:
- int:-2147483648~2147483647
- unsigned int:0~4294967295
- short:-32768~32767
- unsigned short:0~65535
- Long: -2147483648~2147483647
- unsigned long:0~4294967295
Storage space
The following is a list of storage spaces used by common data types
2byte
| data type |
16-bit compiler |
32-bit compiler |
64-bit compiler |
| Char |
1byte |
1byte |
1byte |
| int |
4byte |
4byte |
| float |
4byte |
4byte |
4byte |
| double |
8byte |
8byte |
8byte |
| Short int |
2byte |
2byte |
2byte |
| unsigned int |
2byte |
4byte |
4byte |
| long |
4byte |
4byte |
8byte |
| unsigned long |
4byte |
4byte |
8byte |
| Long Long |
8byte |
8byte |
8byte |
IOS data type