List of Figures

Chapter 2: Hardware Fundamentals

Figure 2.1. RAM vs. CPU speeds

Figure 2.2. A memory hierarchy

Figure 2.3. The first few numbers

Figure 2.4. The next few numbers

Figure 2.5. How many combinations?

Figure 2.6. Binary to hex conversion table

Figure 2.7. Different representations of the same numbers

Figure 2.8. 32 and 16 bit registers, before add ax,1

Figure 2.9. 32 and 16 bit registers, after add ax,1

Figure 2.10. 32 and 16 bit registers, after add eax,1

Figure 2.11. 32 and 16 bit register codes

Figure 2.12. Instruction execution time, using registers and prefetching

Chapter 3: Basics of Programming

Figure 3.1. A little numeric calculation

Figure 3.2. A small section of RAM

Figure 3.3. One little endian value

Figure 3.4. A big endian example

Figure 3.5. Exercise 1

Figure 3.6. A really little numeric calculation

Figure 3.7. Compiling, part 1

Figure 3.8. Compiling, part 2

Figure 3.9. Compiling, part 3

Figure 3.10. Compiling, part 4

Figure 3.11. Before execution

Figure 3.12. After the first instruction is executed

Figure 3.13. After execution of second instruction

Figure 3.14. After execution of third instruction

Figure 3.15. After execution of final instruction

Figure 3.16. Some real characters and strings (codeasic00.cpp)

Figure 3.17. Yet another small section of RAM

Figure 3.18. Special characters for program text

Figure 3.19. A small section of RAM

Figure 3.20. Some simple output (codeasic01.cpp)

Figure 3.21. Some simple input and output (codeasic02.cpp)

Figure 3.22. Using an if statement (codeasic03.cpp)

Figure 3.23. Using a while statement (codeasic04.cpp)

Figure 3.24. A C++ program (codepump1.cpp)

Figure 3.25. First dinner party program (codeasic05.cpp)

Figure 3.26. Second dinner party program (codeasic06.cpp)

Figure 3.27. else if example

Figure 3.28. Name and age program (codeasic07.cpp)

Figure 3.29. Novice program (codeasic08.cpp)

Figure 3.30. Allowance program (codeasic09.cpp)

Chapter 4: More Basics

Figure 4.1. Finding the top two weights, first try (codepump1a.cpp)

Figure 4.2. Susan's solution to the bug in the first attempt

Figure 4.3. Using an if statement with an else clause

Figure 4.4. Finding the top two weights (codepump2.cpp)

Figure 4.5. What if?

Figure 4.6. Using a Vec (codevect1.cpp)

Figure 4.7. Using a for loop (from codevect1.cpp)

Figure 4.8. Sorting the weights (from codevect1.cpp)

Figure 4.9. Elements vs. values

Figure 4.10. Initial situation

Figure 4.11. After the first pass

Figure 4.12. After the second pass

Figure 4.13. Final situation

Figure 4.14. A possible error message

Figure 4.15. Sorting the weights, again (from codevect1.cc)

Figure 4.16. Sorting the weights, with correct initialization (from codevect2.cpp)

Figure 4.17. Garbage prevention, first attempt (from codevect2a.cc)

Figure 4.18. Finding the top three weights using Vecs (codevect3.cc)

Figure 4.19. Exercise 1 (codemorbas00.cpp)

Figure 4.20. Exercise 2 (codemorbas01.cpp)

Figure 4.21. Weight requesting program, first try (codemorbas02.cpp)

Figure 4.22. Error messages from the erroneous weight program (codemorbas02.cpp)

Figure 4.23. The corrected weight program (codemorbas03.cpp)

Figure 4.24. The weight totalling program (codemorbas04.cpp)

Chapter 5: Functional Literacy

Figure 5.1. A sample program with duplicated code (code ofunc.cpp)

Figure 5.2. A function call

Figure 5.3. A function to average two values

Figure 5.4. Argument passing with one argument (codeirthday.cpp)

Figure 5.5. Using the Average function (codefunc1.cpp)

Figure 5.6. Making an executable

Figure 5.7. A stack with one entry

Figure 5.8. A stack with two entries

Figure 5.9. A stack with three entries

Figure 5.10. An empty stack

Figure 5.11. The stack immediately after the call to Average

Figure 5.12. The stack after auto variable allocation

Figure 5.13. Scope vs. storage class

Figure 5.14. Using an auto variable and initializing it (codecount1.cpp)

Figure 5.15. Using an auto variable and not initializing it (codecount2.cpp)

Figure 5.16. Using a local static variable and initializing it explicitly (codecount3.cpp)

Figure 5.17. Using a local static variable and not initializing it explicitly (codecount4.cpp)

Figure 5.18. Using a global variable and initializing it explicitly (codecount5.cpp)

Figure 5.19. Using a global variable and not initializing it explicitly (codecount6.cpp)

Figure 5.20. Using variables of different scopes and storage classes (codescopclas.cpp)

Figure 5.21. The results of using variables of different scopes and storage classes (codescopclas.out)

Figure 5.22. The stack after the initialization of Result

Figure 5.23. The stack after exiting from Average

Figure 5.24. Exercise 1 (codecalc1.cpp)

Chapter 6: Taking Inventory

Figure 6.1. The initial sample program for the StockItem class (codeitemtst1.cpp)

Figure 6.2. Comparison between native and user-defined types

Figure 6.3. The initial interface of the StockItem class (codeitem1.h)

Figure 6.4. The default constructor for the StockItem class (from codeitem1.cpp)

Figure 6.5. Declaring the default constructor for the StockItem class

Figure 6.6. Another way to write the default StockItem constructor

Figure 6.7. Another constructor for the StockItem class (from codeitem1.cpp)

Figure 6.8. Display member function for the StockItem class (from codeitem1.cpp)

Figure 6.9. The initial interface of the StockItem class (codeitem1.h)

Figure 6.10. The initial implementation of the StockItem class (codeitem1.cpp)

Figure 6.11. Reading and displaying a Vec of StockItems (codeitemtst2.cpp)

Figure 6.12. The Read function for the StockItem class (from codeitem2.cpp)

Figure 6.13. The second version of the interface for the StockItem class (codeitem2.h)

Figure 6.14. The declaration of StockItem::Read in codeitem2.h

Figure 6.15. First attempt to update inventory of StockItems (codeitemtst3.cpp)

Figure 6.16. Unauthorized access prohibited

Figure 6.17. An enhanced interface for the StockItem class (codeitem4.h)

Figure 6.18. StockItem::CheckUPC (from codeitem4.cpp)

Figure 6.19. StockItem::DeductSaleFromInventory (from codeitem4.cpp)

Figure 6.20. StockItem::GetInventory (from codeitem4.cpp)

Figure 6.21. StockItem::GetName (from codeitem4.cpp)

Figure 6.22. Updating StockItem inventory (codeitemtst4.cpp)

Figure 6.23. Interface of Inventory class (codeinvent1.h)

Figure 6.24. Default constructor for Inventory class (from codeinvent1.cpp)

Figure 6.25. LoadInventory function for the Inventory class (from codeinvent1.cpp)

Figure 6.26. The implementation of IsNull (from codeitem5.cpp)

Figure 6.27. FindItem function for Inventory class (from codeinvent1.cpp)

Figure 6.28. UpdateItem function for the Inventory class (from codeinvent1.cpp)

Figure 6.29. The implementation of GetUPC (from codeitem5.cpp)

Figure 6.30. The implementation of GetPrice (from codeitem5.cpp)

Figure 6.31. Current interface for Inventory class (codeinvent1.h)

Figure 6.32. Current implementation for Inventory class (codeinvent1.cpp)

Figure 6.33. Current interface for StockItem class (codeitem5.h)

Figure 6.34. Current implementation for StockItem class (codeitem5.cpp)

Figure 6.35. Updated inventory application (codeitemtst5.cpp)

Figure 6.36. The Write member function for the StockItem class (from codeitem6.cpp

Figure 6.37. The StoreInventory member function for the Inventory class (from codeinvent2.cpp)

Figure 6.38. The changes to the application program (from codeitemtst6.cpp)

Chapter 7: Creating a homegrown string class

Figure 7.1. Our string class interface, initial version (codestring1.h)

Figure 7.2. The initial implementation for the string class (codestring1.cpp)

Figure 7.3. The default constructor for our string class (from codestring1.cpp)

Figure 7.4. An empty string in memory

Figure 7.5. Our first test program for the string class (codestrtst1.cpp)

Figure 7.6. The char* constructor for our string class (from codestring1.cpp)

Figure 7.7. string n during construction

Figure 7.8. string n in memory

Figure 7.9. A simple test program for the string class (codestrtst1.cpp)

Figure 7.10. The char* constructor for the string class, again (from codestring1.cpp)

Figure 7.11. strings n and s in memory after compiler-generated =

Figure 7.12. strings n and s in memory after custom =

Figure 7.13. The declaration of operator = for the string class

Figure 7.14. Calling the operator = implementation

Figure 7.15. The assignment operator (operator =) for the string class (from codestring1.cpp)

Figure 7.16. Checking for an exception from new

Figure 7.17. A hypothetical assignment operator (operator =) for the string class with explicit this

Figure 7.18. The destructor for the string class (from code/string1.cpp)

Figure 7.19. Exercise 1 (codestrex1.cpp)

Figure 7.20. Exercise 2 (codestrex2.cpp)

Figure 7.21. Exercise 3 (codestrex3.cpp)

Chapter 8: Finishing our homegrown string class

Figure 8.1. Call by value ("normal argument") using the compiler-generated copy constructor

Figure 8.2. Call by reference

Figure 8.3. Our first test program for the string class (codestrtst1.cpp)

Figure 8.4. Assigning a char* value to a string via string::string(char*)

Figure 8.5. The string class interface (codestring1.h)

Figure 8.6. The copy constructor for the string class (from codestring1.cpp)

Figure 8.7. The string class interface, with Display function (codestring3.h)

Figure 8.8. The latest version of the string class test program, using the Display function (codestrtst3.cpp)

Figure 8.9. The first few lines of the latest implementation of the string class (from string3.cpp)

Figure 8.10. The string class implementation of the Display function (from string3.cpp)

Figure 8.11. Dangerous characters (codedangchar.cpp)

Figure 8.12. Reaping the whirlwind

Figure 8.13. The memory layout before overwriting the data

Figure 8.14. The memory layout after overwriting the data

Figure 8.15. Attempted privacy violation (codestrtst3a.cpp)

Figure 8.16. Trying to access a private member variable illegally

Figure 8.17. Yet another version of the string class interface (codestring4.h)

Figure 8.18. The string class implementation of the GetLength function (from codestring4.cpp)

Figure 8.19. Using the GetLength function in the string class (codestrtst4.cpp)

Figure 8.20. Sorting a Vec of strings (codestrsort1.cpp)

Figure 8.21. The updated string class interface, including comparison and I/O operators (codestring5.h)

Figure 8.22. strings x and y in memory

Figure 8.23. strings x and y in memory, with an embedded null byte

Figure 8.24. Using operator < for strings (codestrtst5x.cpp)

Figure 8.25. The implementation of operator < for strings (from codestring5a.cpp)

Figure 8.26. Is our character less than the one from the other string? (from codestring5a.cpp)

Figure 8.27. The else clause in the comparison loop (from codestring5a.cpp)

Figure 8.28. Handling the return value (from codestring5a.cpp)

Figure 8.29. Implementing operator < for strings (from codestring5.cpp)

Figure 8.30. Implementing operator == for strings (from codestring5.cpp)

Figure 8.31. Chaining several operator << expressions together (codecout1.cpp)

Figure 8.32. An operator << function to output a string (from codestring5.cpp)

Figure 8.33. Why operator << has to be implemented via a global function

Figure 8.34. A operator >> function to input a string (from codestring5.cpp)

Figure 8.35. Error from an uninitialized const (codestring5x.err)

Figure 8.36. Use of a non-const array size (codestring5y.cpp)

Figure 8.37. Exercise 1 (codestrex5.cpp)

Figure 8.38. Exercise 2 (codestrex6.cpp)

Figure 8.39. The string class interface file (from codestring6.h)

Figure 8.40. The string class implementation of operator > (from codestring6.cpp)

Figure 8.41. The string class implementation of operator >= (from codestring6.cpp)

Figure 8.42. The string class implementation of operator != (from codestring6.cpp)

Figure 8.43. The string class implementation of operator <= (from codestring6.cpp)

Figure 8.44. The test program for the comparison operators of the string class (codestrcmp.cpp)

Chapter 9: Inheritance

Figure 9.1. The next StockItem header file (codeitem20.h)

Figure 9.2. The next implementation of StockItem (codeitem20.cpp)

Figure 9.3. The next header file for the Inventory class (codeinvent20.h)

Figure 9.4. The StockItem test program for the base StockItem class (codeitmtst20.cpp)

Figure 9.5. The implementation of the Inventory class (codeinvent20.cpp)

Figure 9.6. The Reorder function for the StockItem class (from codeitem20.cpp)

Figure 9.7. Simplified interface for StockItem and DatedStockItem classes (codeitema.h)

Figure 9.8. A simplified StockItem object

Figure 9.9. A DatedStockItem object

Figure 9.10. A derived class object with its base class part

Figure 9.11. The next version of the inventory control test program (codeitmtst21.cpp)

Figure 9.12. Full interface for StockItem and DatedStockItem (codeitem21.h)

Figure 9.13. Latest implementation of StockItem class and first implementation of DatedStockItem class (codeitem21.cpp)

Figure 9.14. DatedStockItem::Today() (from codeitem21.cpp)

Figure 9.15. A simple stream example (codestream1.cpp)

Figure 9.16. An empty ostream object

Figure 9.17. An ostream object with some data

Figure 9.18. An ostream object with some more data.

Figure 9.19. An empty ostream object

Figure 9.20. A stringstream formatting example (codestream2.cpp)

Figure 9.21. An empty stringstream object

Figure 9.22. A stringstream object with some contents

Figure 9.23. A stringstream object with some more contents

Figure 9.24. A stringstream object with even more contents

Figure 9.25. A stringstream object after reading its contents

Figure 9.26. Default formatting example (codecoutdef1.cpp)

Figure 9.27. Output of default formatting example (codecoutdef1.out)

Figure 9.28. Output of controlled formatting example (codecoutdef2.out)

Figure 9.29. Controlled formatting example (codecoutdef2.cpp)

Figure 9.30. Default constructor for DatedStockItem (from codeitem21.cpp)

Figure 9.31. Specifying the base class constructor for a derived class object

Figure 9.32. Constructing a default DatedStockItem object

Figure 9.33. Normal constructor for DatedStockItem (from codeitem21.cpp)

Figure 9.34. Constructing a DatedStockItem object

Figure 9.35. The Reorder function for DatedStockItem (from codeitem21.cpp)

Figure 9.36. Calling Reorder through a StockItem pointer, part 1

Figure 9.37. Calling Reorder through a DatedStockItem pointer

Figure 9.38. Calling Reorder through a StockItem pointer, part 2

Figure 9.39. Function call example (code virtual.cpp)

Figure 9.40. Function call example output (code virtual.out)

Figure 9.41. Simplified implementation for StockItem and DatedStockItem classes (codeitema.cpp)

Chapter 10: Polymorphism

Figure 10.1. Dangerous polymorphism: Interfaces of StockItem and DatedStockItem with virtual Reorder function (codeitemb.h)

Figure 10.2. virtual function call example output (codevirtual.out)

Figure 10.3. A simplified StockItem object without virtual functions

Figure 10.4. Dangerous polymorphism: A simplified StockItem object with a virtual function

Figure 10.5. Dangerous polymorphism: A simplified DatedStockItem object with a virtual function

Figure 10.6. Dangerous polymorphism: Calling a virtual Reorder function through a StockItem pointer to a StockItem object

Figure 10.7. Dangerous polymorphism: Calling a virtual Reorder function through a DatedStockItem pointer to a DatedStockItem object

Figure 10.8. Dangerous polymorphism: Calling a virtual Reorder function through a StockItem pointer to a DatedStockItem object

Figure 10.9. Dangerous polymorphism: A simplified StockItem object with two virtual functions

Figure 10.10. Dangerous polymorphism: A simplified DatedStockItem with two virtual functions

Figure 10.11. Dangerous polymorphism: Using operator << with a StockItem* (codepolyioa.cpp)

Figure 10.12. Result of using operator << with a StockItem* (codepolyioa.out)

Figure 10.13. Dangerous polymorphism: StockItem interface with operator << and operator >> (codeitemc.h)

Figure 10.14. Dangerous polymorphism: StockItem implementation with operator << and operator >> (codeitemc.cpp)

Figure 10.15. Dangerous polymorphism: The implementation of operator << with a StockItem* (from codeitemc.cpp)

Figure 10.16. Dangerous polymorphism: StockItem::Write (from codeitemc.cpp)

Figure 10.17. Dangerous polymorphism: DatedStockItem::Write (from codeitemc.cpp)

Figure 10.18. Dangerous polymorphism: Using operator >> and operator << with a StockItem* (codepolyiob.cpp)

Figure 10.19. Dangerous polymorphism: The results of using operator >> and operator << with a StockItem* (codepolyiob.out)

Figure 10.20. Dangerous polymorphism: The implementation of operator >> (from codeitemc.cpp)

Figure 10.21. Safe polymorphism: Using operator >> and operator << with a polymorphic StockItem (codepolyioc.cpp)

Figure 10.22. Safe polymorphism: The polymorphic object version of the StockItem interface (codeitemp.h)

Figure 10.23. Safe polymorphism: The UndatedStockItem and DatedStockItem interfaces for the polymorphic version of StockItem (codeitempi.h)

Figure 10.24. Safe polymorphism: The implementation of the UndatedStockItem and DatedStockItem classes (codeitemp.cpp)

Figure 10.25. Safe polymorphism: The implementation of operator << for a polymorphic StockItem (from codeitemp.cpp)

Figure 10.26. Safe polymorphism: A polymorphic StockItem object with no date

Figure 10.27. Safe polymorphism: A polymorphic StockItem object with a date

Figure 10.28. A simplified version of the structure of a DatedStockItem object

Figure 10.29. Safe polymorphism: The default constructor for the polymorphic StockItem class (from codeitemp.cpp)

Figure 10.30. Safe polymorphism: A default-constructed polymorphic StockItem object

Figure 10.31. Safe polymorphism: The default constructor for the UndatedStockItem class (from codeitemp.cpp)

Figure 10.32. Safe polymorphism: Implementing a special protected constructor for StockItem (from codeitemp.cpp)

Figure 10.33. Safe polymorphism: An example program for reference-counting with StockItems (code efcnt1.cpp)

Figure 10.34. Safe polymorphism: A normal constructor to create a StockItem without a date (from codeitemp.cpp)

Figure 10.35. Safe polymorphism: A polymorphic StockItem object with an UndatedStockItem worker

Figure 10.36. Safe polymorphism: A normal constructor that constructs a StockItem having a date (from codeitemp.cpp)

Figure 10.37. Safe polymorphism: A polymorphic StockItem object with a DatedStockItem worker

Figure 10.38. Safe polymorphism: The copy constructor for StockItem (from codeitemp.cpp)

Figure 10.39. Safe polymorphism: Two polymorphic StockItem objects sharing the same UndatedStockItem worker object

Figure 10.40. Safe polymorphism: The assignment operator (operator =) for StockItem (from codeitemp.cpp)

Figure 10.41. Safe polymorphism: Two polymorphic StockItem objects sharing the same DatedStockItem worker object

Figure 10.42. Safe polymorphism: A polymorphic StockItem object

Figure 10.43. Safe polymorphism: The destructor for the StockItem class (from codeitemp.cpp)

Figure 10.44. Safe polymorphism: The destructor for the StockItem class (from codeitemp.cpp)

Chapter 11: The Home Inventory Project

Figure 11.1. The initial interface for the HomeItem manager class (code/hmit1.h)

Figure 11.2. The initial interface for the HomeItemBasic and HomeItemMusic worker classes (codehmiti1.h)

Figure 11.3. The initial test program for the HomeItem classes (codehmtst1.cpp)

Figure 11.4. Results of running the first HomeItem test program (codehmit1.out)

Figure 11.5. Initial implementation of HomeItem manager and worker classes (codehmit1.cpp)

Figure 11.6. HomeItem::Write (from codehmit1.cpp)

Figure 11.7. The HomeItem implementation of operator >> (from codehmit1.cpp)

Figure 11.8. The (incorrect) while loop in the original implementation of operator >>

Figure 11.9. A legal program (codefortest.cpp)

Figure 11.10. An incorrect default constructor for the HomeItemBasic class (strzero.err)

Figure 11.11. HomeItemBasic::GetType (from codehmit1.cpp)

Figure 11.12. HomeItemMusic::GetType (from codehmit1.cpp)

Figure 11.13. HomeItemBasic::Write (from codehmit1.cpp)

Figure 11.14. HomeItemMusic::Write (from codehmit1.cpp)

Figure 11.15. The initial HomeInventory class interface (codehmin2.h)

Figure 11.16. The initial implementation of HomeInventory (codehmin2.cpp)

Figure 11.17. Yet another implementation of LoadInventory (from codehmin3.cpp)

Figure 11.18. The next interface for the HomeInventory class (codehmin4.h)

Figure 11.19. The AddItem member function of HomeInventory (from codehmin4.cpp)

Figure 11.20. The new interface for HomeItem (codehmit4.h)

Figure 11.21. The implementation of HomeItem::NewItem() (from codehmit4.cpp)

Figure 11.22. The new version of operator >> (from codehmit4.cpp)

Figure 11.23. HomeItemBasic::FormattedDisplay (from codehmit4.cpp)

Figure 11.24. HomeItemMusic::FormattedDisplay (from codehmit4.cpp)

Figure 11.25. The test program for adding a HomeItem interactively (hmtst4.cpp)

Figure 11.26. The next version of the interface for HomeInventory (codehmin5.h)

Figure 11.27. The next version of the HomeInventory test program (codehmtst5.cpp)

Figure 11.28. The EditItem function of HomeInventory (from codehmin5.cpp)

Figure 11.29. The latest version of the Homeitem class interface (codehmit5.h)

Figure 11.30. HomeItem::Edit (from codehmit5.cpp)

Figure 11.31. HomeItemBasic::CopyData() (from codehmit5.cpp)

Figure 11.32. The latest version of operator >> (from codehmit5.cpp)

Figure 11.33. The latest version of the interface for the HomeItem worker classes (codehmiti5.h)

Figure 11.34. HomeItemBasic::GetFieldName (from codehmit5.cpp)

Figure 11.35. HomeItem::Read (from codehmit5.cpp)

Figure 11.36. HomeItemBasic::Read (from codehmit5.cpp)

Figure 11.37. HomeItemBasic::ReadInteractive (from codehmit5.cpp)

Figure 11.38. HomeItemBasic::ReadFromFile (from codehmit5.cpp)

Figure 11.39. HomeItemBasic::Edit (from codehmit5.cpp)

Figure 11.40. HomeItemBasic::FormattedDisplay (from codehmit5.cpp)

Figure 11.41. HomeItemBasic::EditField (from codehmit5.cpp)

Figure 11.42. HomeItemMusic::FormattedDisplay (from codehmit5.cpp)

Figure 11.43. HomeItemMusic::ReadInteractive (from codehmit5.cpp)

Figure 11.44. HomeItemMusic::ReadFromFile (from codehmit5.cpp)

Figure 11.45. HomeItemMusic::EditField (from codehmit5.cpp)

Chapter 12: More on the Home Inventory Project

Figure 12.1. The new xstring class interface (codexstring.h)

Figure 12.2. The default constructor for the xstring class (from codexstring.h)

Figure 12.3. The copy constructor for the xstring class (from codexstring.h)

Figure 12.4. Another constructor for the xstring class (from codexstring.h)

Figure 12.5. A little test program for an early version of the xstring class (codexstrtstc.cpp)

Figure 12.6. An early version of the xstring header file (codexstringc.h)

Figure 12.7. An error message from mixing strings and xstrings

Figure 12.8. Another version of the xstring header file (codexstringd.h)

Figure 12.9. A successful attempt to mix strings and xstrings (codexstrtstd.cpp)

Figure 12.10. The char* constructor for the xstring class (from codexstring.h)

Figure 12.11. Another constructor for the xstring class (from codexstring.h)

Figure 12.12. The final constructor for the xstring class (from codexstring.h)

Figure 12.13. An illegal program (codestrzero.cpp)

Figure 12.14. The error message from compiling that illegal program (codestrzero.err)

Figure 12.15. A legal but dubious program (codestrone.cpp)

Figure 12.16. The final version of the xstring header file (codexstring.h)

Figure 12.17. An illegal program (codestrfix.cpp)

Figure 12.18. The error message from strfix.cpp (codestrfix.err)

Figure 12.19. Using xstring::find_nocase (codexstrtstb.cpp)

Figure 12.20. The implementation of xstring::find_nocase (from codexstring.cpp)

Figure 12.21. The less_nocase function (from codexstring.cpp)

Figure 12.22. The latest home inventory application program (codehmtst6.cpp)

Figure 12.23. The latest version of the HomeInventory interface (hmin6.h)

Figure 12.24. HomeInventory::FindItemByDescription (from codehmin6.cpp)

Figure 12.25. The new version of the HomeItem interface (codehmit6.h)

Figure 12.26. HomeItemBasic::IsNull (from codehmit6.cpp)

Chapter 13: Analyzing the Home Inventory Project

Figure 13.1. The main() function of the final version of the home inventory main program (from codehmtst8.cpp)

Figure 13.2. The MenuItem enum (from codehmtst8.cpp)

Figure 13.3. The GetMenuChoice function (from codehmtst8.cpp)

Figure 13.4. ExecuteMenuChoice (from codehmtst8.cpp)

Figure 13.5. The HomeUtility interface (codehmutil1.h)

Figure 13.6. Not declaring a default argument (code odef.h)

Figure 13.7. Not using a default argument (code odef.cpp)

Figure 13.8. Declaring a default argument (codedefault.h)

Figure 13.9. Using a default argument (code odef.cpp)

Figure 13.10. HomeUtility::ReadDoubleFromLine (from codehmutil1.cpp)

Figure 13.11. HomeUtility::ReadLongFromLine (from codehmutil1.cpp)

Figure 13.12. HomeUtility::ReadDateFromLine (from codehmutil1.cpp)

Figure 13.13. HomeUtility::IgnoreTillCR (from codehmutil1.cpp)

Figure 13.14. HomeUtility::HandleError (from codehmutil1.cpp)

Figure 13.15. HomeUtility::CheckNumericInput (from codehmutil1.cpp)

Figure 13.16. HomeUtility::GetNumberOrEnter (from codehmutil1.cpp)

Figure 13.17. HomeUtility::ClearRestOfScreen (from codehmutil1.cpp)

Figure 13.18. The HomeUtility::SelectItem function (from codehmutil1.cpp)

Figure 13.19. The latest header file for the HomeInventory class (codehmin8.h)

Figure 13.20. The latest version of HomeInventory::AddItem (from codehmin8.cpp)

Figure 13.21. The latest version of HomeInventory::EditItem (from codehmin8.cpp)

Figure 13.22. The latest version of HomeInventory::LocateItemByDescription (from codehmin8.cpp)

Figure 13.23. HomeInventory::LocateItemByCategory (from codehmin8.cpp)

Figure 13.24. The HomeInventory::PrintNames function (from codehmin8.cpp)

Figure 13.25. The HomeInventory::PrintAll function (from codehmin8.cpp)

Figure 13.26. The HomeInventory::StoreInventory function (from codehmin8.cpp)

Figure 13.27. The HomeInventory::DisplayItem function (from codehmin8.cpp)

Figure 13.28. The HomeInventory::SortInventoryByName function (from codehmin8.cpp)

Figure 13.29. The HomeInventory::SelectItemByPartialName function (from codehmin8.cpp)

Figure 13.30. The HomeInventory::SelectItemFromNameList function (from codehmin8.cpp)

Figure 13.31. The HomeInventory::SelectItemFromCategoryList function (from codehmin8.cpp)

Figure 13.32. The HomeInventory::DeleteItem function (from codehmin8.cpp)

Figure 13.33. The new operator >> implementation for the HomeItem classes (from codehmit8.cpp)

Figure 13.34. The latest version of HomeItemBasic::Edit (from codehmit8.cpp)

Figure 13.35. The latest version of HomeItemBasic::ReadInteractive (from codehmit8.cpp)

Figure 13.36. The latest version of the HomeItemBasic::EditItem function (from codehmit8.cpp)

Figure 13.37. The latest version of HomeItemMusic::ReadInteractive (from codehmit8.cpp)

Figure 13.38. The latest version of HomeItemMusic::EditField (from codehmit8.cpp)

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset