Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - What is the difference between long and int in C?
What is the difference between long and int in C?
1, integer data is numeric data with no decimal part, and it is represented by the letter I. Integer data is only used to represent integers and is stored in binary form.

2. The binary bit length of short integer is 16, and that of long integer is 32 bits. That is, a long integer can represent an integer with more digits. The integer range that short integers can represent is -32768~32767.

3. The long integer is-2147483648 ~ 214743647. For example, there is a number 32780, which can only be represented by a long integer, not a short integer.

4. Long integer is a representation of data type in programming. Long is usually used to represent long integers. The range of signed 64-bit integer of Long is -2 63-2 63- 1 int 64; the 64-bit integer of unsigned long is 0-2 64- 1 uint64.

The difference is that the basic stereotypes of C, like long integers, came with the development of computer technology. Early computers had 16 bits, integers had 16 bits, and int long had 32 bits, but the ranges were different. With the development of computers and the development of C language standards, the mainstream of computers is 32 bits, so resources are no longer so tight. C99 stipulates that int is 32 bits, and so is long.