#long is a keyword in C language, representing a data type, which is long integer in Chinese.
long is the abbreviation of long int, that is to say, in C language, the long int type and the long type are the same.
Each long type occupies 4 bytes. Under a 32-bit compilation system, long and int occupy the same space. This has also led to the use of long variables less and less.
The range of integer numbers that the long type can represent is -2,147,483,648 ~ 2,147,483,647, that is, -2^32 ~ 2^32-1.
When used in C formatted input and output, the long formatting character is "%ld".
long, like other integer types, can be used in conjunction with unsigned to form unsigned long, that is, an unsigned long integer, and its formatting character is "%lu".
Under some compilers, such as gcc, two longs are used together, that is, long long type, which represents the longest system integer type in C language. Each long long type occupies 8 bytes and 64 bits. Its formatting character is "%lld".
Recommended: "c Language Tutorial"
The above is the detailed content of What does long mean in c language?. For more information, please follow other related articles on the PHP Chinese website!