Review

We started this chapter with our work cut out for us; the program was performing as intended, so we just had to go over exactly how it worked. We started with the new main function, which consists of two consecutive “endless” loops (loops that execute until a particular criterion is met, rather than for a predetermined number of times). The first loop keeps executing as long as the user is still entering, modifying, or examining the data in the inventory. When the user is finished with these operations, the only remaining question is whether he or she wants to save the changes to the inventory, so the code in the second loop is designed to find the answer to that question and either save or discard the changes as desired.

The main work ...

Get C++: A Dialog Programming with the C++ Standard Library 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.