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

Getting Organized

By now, you have probably noticed the rhythm of development: add features, develop features, refactor, retest, and repeat. It is time once again to shift things around in the example.

Figure 15.1 shows the new organization. Accumulator(), Tape(), and the parts of main() that interact with the user have each been moved into their own modules. These three modules are all in the SAMSCalculator namespace.

Figure 15.1. A new arrangement of modules.

The arrows show how the functions call each other. main() calls CalculateFromInput(), which calls Accumulator() and Tape(). main() can also call functions in the other modules.

After this ...

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