B. Data Types

Although the C++ specification is somewhat general when it comes to ranges of types, certain ranges are (for all practical purposes) universal on computers with a 32-bit architecture. This includes all personal computers in use today, both PCs and Macs. However, some of these ranges are subject to change. When 64-bit architecture becomes standard, for example, you should expect int to be identified with 64-bit integers.

The int and double types are the “natural” sizes for integer and floating-point numbers, respectively, for the computer’s own architecture. This means that when any integer type is used in an expression (such as char), it is automatically promoted to int provided that can be done without loss of information. There ...

Get C++ Without Fear: A Beginner’s Guide That Makes You Feel Smart, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.