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

Initialization

Listing 19.2 shows the definition (implementation) of the class aRequest.

Listing 19.2. aRequest Implementation
 *1: #include "RequestModule.h"
  2:
 *3: namespace SAMSCalculator
 *4: {
 *5:    aRequest::aRequest ( const anOperator theOperator, const float theOperand ):
 *6:       myOperator(theOperator),
 *7:       myOperand(theOperand)
 *8:    {
 *9:    };
 10:
*11:    aRequest::aRequest(const aRequest &theRequest):
*12:       myOperator(theRequest.myOperator),
*13:       myOperand(theRequest.myOperand)
*14:    {
*15:    }
 16:
 17:    aRequest::anOperator aRequest::Operator(void) const
 18:    {
 19:       return myOperator;
 20:    };
 21:
 22:    float aRequest::Operand(void) const
 23:    {
 24:       return myOperand;
 25:    };
*26: };

Line 1 includes the class declaration header file so that the compiler ...

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