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

Get SAMS Teach Yourself C++ in 10 Minutes SECOND EDITION now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.