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

The main.cpp

main.cpp (see Listing 20.9) instantiates everything, hands the objects over to aController, and then starts the Calculator operating.

Listing 20.9. main.cpp
 1: #include "ExternalInterfaceModule.h"
 2: #include "AccumulatorModule.h"
 3: #include "TapeModule.h"
 4: #include "ControllerModule.h"
 5:
 6: int main(int argc, char* argv[])
 7: {
 8:    SAMSCalculator::anExternalInterface ExternalInterface;
 9:    SAMSCalculator::anAccumulator          Accumulator;
10:    SAMSCalculator::aTape                  Tape;
11:
12:    SAMSCalculator::aController            Calculator
13:    (
14:       ExternalInterface,
15:       Accumulator,
16:       Tape
17:    );
18:
19:    return Calculator.Operate();
20: }

Lines 8–10 ...

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