This article mainly introduces the differences between the basic data types of 32-bit and 64-bit machines in linux. For more information, see basic data types.
| Data type |
32-bit |
64-bit |
| Char |
1 |
1 |
| Int |
4 |
4 |
Long
|
4 |
8 |
| Float |
4 |
4 |
| Double |
8 |
8 |
| Long double |
12 |
16 |
| Long |
8 |
8 |
You can specify the length of an int:
| Data type |
32-bit |
64-bit |
| Int32_t |
4 |
4 |
Int64_t
|
8 |
8 |
Similarly, uint32_t and uint64_t
Other data types
1, size_t: same as the machine font;
2. off_t: the default 32-bit length for 32-bit machines. in this case, you cannot offset files larger than 4 GB. in this case, off_t = _ off_t; if you want to perform a file offset operation greater than 4G, you can add the header file in the program before defining
In this case, off_t = _ off64_t is defined in unistd. h. for 64-bit machines, the default value is 64-bit length.
# Define _ FILE_OFFSET_BITS 64
3. ino_t: same as the machine font.