Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - What's the difference between an integer in C and a long integer? Except that one occupies 2 bytes and one occupies 4 bytes? Thank you~
What's the difference between an integer in C and a long integer? Except that one occupies 2 bytes and one occupies 4 bytes? Thank you~
One byte less, one byte more,

In standard c, the byte length of int is less than long and greater than short. On most platforms, int is 4 bytes (32 bits, not 16 bits! ), so the range that can be expressed is 2 to the 32nd power, and the value is-2 (32-1) ~ 2 (32-1)-1(that is, -2 3 1 ~ 2 36544).

According to different needs, int includes the following definitions:

Unsigned short integer unsigned double-byte short integer

Short Integer Signed 2 Byte Short Integer -32768 ~ 32767

Unsigned int unsigned 4-byte integer 0 ~ 2 32- 1 (this is correct)

Int 4 byte shaping-231~ 231-1

Int 64 64-bit (8 bytes) shaping-2 63 ~ 2 63- 1 (this is rarely used, usually expressed as high-order int and low-order int, and Bayesian arc now gives its range incorrectly).