Notes on Data Types

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, ints are equivalent either to short or to long. The ...

Get C++11 for Programmers, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.