Chapter 4. Types and Declarations

 

Accept nothing short of perfection!

 
 --anon
 

Perfection is achieved only on the point of collapse.

 
 --C. N. Parkinson

Typesfundamental typesBooleanscharacterscharacter literalsintegersinteger literalsfloating-point typesfloating-point literalssizesvoidenumerationsdeclarationsnamesscopeinitializationobjectstypedefsadviceexercises.

Types

Consider

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 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.