August 2002
Beginner
1122 pages
22h 1m
English
Now let's get to the detailed analysis of the final version of the home inventory program. We'll start with the main() function of this program, which is shown in Figure 13.1.
int main() { ifstream HomeInfo("home.inv"); HomeInventory MyInventory; char option; string answer; MyInventory.LoadInventory(HomeInfo); for (;;) { option = GetMenuChoice(MyInventory); if (option == Exit) break; else ExecuteMenuChoice(option,MyInventory); } HomeInfo.close(); for (;;) { cout << "Save the changes you have made? (Y/N) "; cin >> answer; if ((answer == "Y") || (answer == "y")) { ofstream NewHomeInfo("home.inv"); ... |
Read now
Unlock full access