Home > Backend Development > C#.Net Tutorial > What does long mean in c language?

What does long mean in c language?

Release: 2020-03-03 10:53:32
Original
14061 people have browsed it

What does long mean in c language?

#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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template