Get the App
SLTechnology News&Howtos  ›  Servers  › 

What is the difference in the length of basic data types between 32-bit and 64-bit computers under linux

Shulou Source: shulou.com Published: 2022-06-01 06:38:30 10月01日 Update

This article mainly introduces the linux 32-bit machine and 64-bit machine basic data type length difference, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.

Basic data type

Data type 32-bit 64-bit char11int44long

48float44double88long double1216long long88

You can specify the length of the int:

Data type 32-bit 64-bit int32_t44int64_t

eighty-eight

Similarly, there are uint32_t and uint64_t.

Other data types

1 minute sizeroomt: the word length is the same as the machine

2 off_t offset: the default length is 32 bits on a 32-bit machine, so you cannot offset files larger than 4G. If you want to offset files greater than 4G, you can define them before adding header files to the program.

In this case, off_t = _ _ off64_t, which is defined in unistd.h. For 64-bit machines, the default is 64-bit length.

# define _ FILE_OFFSET_BITS 64

3The word length is the same as that of the machine.

Thank you for reading this article carefully. I hope the article "what is the difference in the length of basic data types between 32-bit and 64-bit computers under linux" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Tags: Data type article length document machine machine word offset value interest and at the same time more friends knowledge programs ribbons industry information information channels Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Shulou Information Apple NVidia Linux