C++ has flexible data type sizes (see Appendix C, Fundamental Types). Different applications, for example, might need integers of different sizes. C++ provides several integer types. The range of integer values for each type is platform dependent. In addition to the types int
and char
, C++ provides the types short
(an abbreviation of short int
), long
(an abbreviation of long int
) and long long
(an abbreviation of long long int
). The minimum range of values for short
integers is –32,767 to 32,767. For the vast majority of integer calculations, long
integers are sufficient. The minimum range of values for long
integers is –2,147,483,647 to 2,147,483,647. On most computers, int
s are equivalent either to short
or to long
. The range of values for an int
is at least the same as that for short
integers and no larger than that for long
integers. The data type char
can be used to represent any of the characters in the computer’s character set. It also can be used to represent small integers.