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

What does long mean in c language?

藏色散人
藏色散人Original
2020-02-20 10:48:0836496browse

What does long mean in c language?

What does long mean in C language?

1. Long is a keyword in C language, representing a data type, and Chinese is long integer.

2. 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.

3. 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.

Recommended: "c Language Tutorial"

4. 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".

5. Long, like other integer types, can be used in conjunction with unsigned to form unsigned long, which is an unsigned long integer type, and its formatting character is "%lu".

6. 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, 64 Bit. Its formatting character is "%lld".

For more programming related content, please pay attention to the Programming Introduction column on the php Chinese website!

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!

Statement:
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