1, different definitions
Int type is called integer.
Short types are called short integers;
Long type is called long integer;
2. The number of bytes occupied is different.
A short integer variable of Two bytes;
Four bytes of type int (in a 32-bit machine);
Long int takes 8 bytes (in a 32-bit computer);
3. Different data ranges
The value of the short int variable is -( 16 to the second power)+1 to (15 to the second power)-1;
The value of an int variable is -(2 to the 32nd power)+1 to (2 to the 3rd1power)-1;
The value of the long variable is -(2 to the 64th power)+1 to (2 to the 63rd power)-1;
Extended data
1, the specific occupation of several bytes is not specified in C language, but it is widely defined in C language:
1), short integer takes up at least 2 bytes.
The type of int is suggested to be machine word length. The machine word length is 4 bytes in 32-bit environment and 8 bytes in 64-bit environment.
3) The length of short type cannot be greater than int, and the length of long type cannot be less than int.
reference data
Baidu encyclopedia -C language