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 8. Namespaces and Exceptions

 

The year is 787! A.D.?

 
 --Monty Python
 

No rule is so general, which admits not some exception.

 
 --Robert Burton

Modularity, interfaces, and exceptionsnamespacesusingusing namespaceavoiding name clashesname lookupnamespace compositionnamespace aliasesnamespaces and C codeexceptionsthrow and catchexceptions and program structureadviceexercises.

Modularization and Interfaces

Any realistic program consists of a number of separate parts. For example, even the simple “Hello, world!” program involves at least two parts: the user code requests Hello, world! to be printed, and the I/O system does the printing.

Consider the desk calculator example from §6.1. It can be viewed as being ...

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