Chapter 4. Types and Declarations


Accept nothing short of perfection!


Perfection is achieved only on the point of collapse.

 --C. N. Parkinson

Typesfundamental typesBooleanscharacterscharacter literalsintegersinteger literalsfloating-point typesfloating-point literalssizesvoidenumerationsdeclarationsnamesscopeinitializationobjectstypedefsadviceexercises.



x = y+f(2);

For this to make sense in a C++ program, the names x, y, and f must be suitably declared. That is, the programmer must specify that entities named x, y, and f exist and that they are of types for which = (assignment), + (addition), and () (function call), respectively, are meaningful.

Every name (identifier) ...

Get The C++ Programming Language, Special Edition now with O’Reilly online learning.

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