O'Reilly logo

The C++ Programming Language, Special Edition by New Jersey Stroustrup Bjarne AT&T Labs Murray Hill

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required