Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - What's the difference between plastic int and long plastic long in C++? Aren't they all 4 bytes and 32 bits?
What's the difference between plastic int and long plastic long in C++? Aren't they all 4 bytes and 32 bits?
The C++ standard only stipulates that the number of bytes of int data is not greater than long and not less than short. You are talking about the situation on a 32-bit computer. Make the following comparison:

16 bit platform

Char 1 byte and 8 bits

Short 2 bytes 16 bits

Int 2 bytes 16 bits

4 bytes long, 32 bits

Pointer 2 bytes

32-bit platform

Char 1 byte and 8 bits

Short 2 bytes 16 bits

Int 4 bytes 32 bits

4 bytes long

Long long 8 bytes

Pointer 4 bytes

64-bit platform

Char 1 byte

Short 2 bytes

Int 4 bytes

8 bytes long (difference)

Long long 8 bytes

Pointer 8 bytes (difference)