short
is an integral data type that is
at least two bytes, but could be more.
long
is an integral data type that is
at least four bytes, but could be more.
long long
is an integral data type that is
at least 8 bytes, but could be more.
int
is an integral data type that is the same size or larger than
short
, but also the same size or smaller than
long
. It could be the same as one or the other, or it could be in the middle.
signed
can come before
char
,
short
,
int
,
long
, or
long long
and ensures that the type can hold both positive and negative numbers.
unsigned
can come before
char
,
short
,
int
,
long
, or
long long
and ensures that the type will only hold positive numbers.
Signed and Unsigned types both have the same number of total values, but the maximum positive value for signed is normally half the maximum positive value for unsigned.
In this post I use the word "byte" to mean 8 bits, however the standard defines the requirements in terms of bits, not bytes, because C++ does not require that a byte be 8 bits - it is allowed for a byte to be 11 bits, for example.