INT and short int are different.
According to the C ++ standard, int occupies the word length of a machine. In 32-bit systems, int occupies 32 bits, that is, 4 bytes,
In the old 16-bit system, int occupies 16 bits, that is, two bytes.
The C ++ standard only specifies that the short int cannot exceed the length of the int. The specific length can be determined by the Implementation vendor of the C ++ compiler. Currently, in the popular 32-bit C ++ compiler,
Generally, int occupies 4 bytes, while short int occupies 2 bytes. Short int can be abbreviated as short. Similarly, the C ++ standard only limits the length of long int to be smaller than that of Int.
It should be related to the CPU architecture and the compilation system. Haha.
I am also confused about this problem !!!
The result of my 32-bit machine VC ++ is
Short integer short Int = 16-bit = 2 bytes
Integer Int = 32-bit = 4 bytes
Long Integer long Int = 32-bit = 4 bytes
Single precision float = 32-bit = 4 bytes
Double = 64-bit = 8 bytes
Long Integer double = 64-bit = 8 bytes
Character char = 8-bit = 1 byte
Unsigned escape char = 8-bit = 1 byte
Signed signature type signed Char = 8-bit = 1 byte
Unsigned integer Int = 32-bit = 4 bytes
Signed integer signed Int = 32-bit = 4 bytes
Unsigned long integer signed long Int = 32-bit = 4 bytes
In tc2.0
Short Int = 16 bit = 2 byte
Int = 16 bit = 2 byte
Long Int = 32 bit = 4 byte
Float = 32 bit = 4 byte
Double = 64 bit = 8 byte
Long Double = 80 bit = 10 byte
Char = 8 bit = 1 byte
Unsigned char = 8 bit = 1 byte
Signed Char = 8 bit = 1 byte
Unsigned Int = 16 bit = 2 byte
Signed Int = 16 bit = 2 byte
Signed long Int = 32 bit = 4 byte
TC
Long Double = 80 bit = 10 byte
VC ++
Long Double = 64-bit = 8 bytes
2 bytes missing
My summary should be related to the compilation system, which is defined by the machine.
Also follow short int <= long int