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

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.