Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - What is the difference between a short integer and a long integer?
What is the difference between a short integer and a long integer?
They are all of the same data type, the difference is that the range of values and bit size are different, and different data type variables are applied to different values.

The binary bit length of short integers is 16, and that of long integers 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.

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

Basic usage

1、C++? & ampC short is a data type ranging from -32768 to +32767.

2, * * * there are two kinds:

Unsigned short I; I can represent 0~65535.

Signed (default) short i; I can refer to -32768~+32767.