O'Reilly logo

SAMS Teach Yourself C++ in 10 Minutes SECOND EDITION by Jesse Liberty

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

Class Notation

As you saw earlier, there are two parts to a class: the class declaration, which goes in the module header file, and the class definition, which goes in the module implementation file.

The class declaration for a simple class, such as aRequest, shows most of the notation used for a class definition (see Listing 19.1).

Listing 19.1. aRequest Header
 *1: #ifndef RequestModuleH *2: #define RequestModuleH 3: *4: namespace SAMSCalculator *5: { *6: class aRequest *7: { 8: public: 9: *10: enum anOperator *11: { *12: add, *13: subtract, *14: multiply, *15: divide, *16: query, *17: reset, *18: selftest, *19: querytape, *20: stop *21: }; 22: 23: // Note: There is no default constructor 24: // you must provide an operator and operand when ...

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