O'Reilly logo

C++ How to Program, Sixth Edition by H. M. Deitel - Deitel & Associates, Inc., P. J. Deitel - Deitel & Associates, Inc.

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 9. Classes: A Deeper Look, Part 1

 

My object all sublime I shall achieve in time.

 
 --W. S. Gilbert
 

Is it a world to hide virtues in?

 
 --William Shakespeare
 

Don’t be “consistent,” but be simply true.

 
 --Oliver Wendell Holmes, Jr.
 

This above all: to thine own self be true.

 
 --William Shakespeare

OBJECTIVES

In this chapter you’ll learn:

  • How to use a preprocessor wrapper to prevent multiple definition errors caused by including more than one copy of a header file in a source-code file.

  • To understand class scope and accessing class members via the name of an object, a reference to an object or a pointer to an object.

  • To define constructors with default arguments.

  • How destructors are used to perform “termination housekeeping” on an object before it ...

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