11.07.2015 Views

tYSR20

tYSR20

tYSR20

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

xii C++ For Dummies, 5th EditionCreating Shallow Copies Is a Deep Problem .............................................307Overloading the Assignment Operator .....................................................308Protecting the Escape Hatch ......................................................................311Chapter 24: Using Stream I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .313How Stream I/O Works.................................................................................313The fstream Subclasses...............................................................................315Reading Directly from a Stream..................................................................320What’s Up with endl? ...................................................................................322Using the strstream Subclasses .................................................................322Manipulating Manipulators.........................................................................325Chapter 25: Handling Errors — Exceptions . . . . . . . . . . . . . . . . . . . . .329Justifying a New Error Mechanism?...........................................................331Examining the Exception Mechanism........................................................332What Kinds of Things Can I Throw? ..........................................................335Chapter 26: Inheriting Multiple Inheritance . . . . . . . . . . . . . . . . . . . . .339Describing the Multiple Inheritance Mechanism .....................................339Straightening Out Inheritance Ambiguities ..............................................341Adding Virtual Inheritance..........................................................................342Constructing the Objects of Multiple Inheritance ...................................349Voicing a Contrary Opinion ........................................................................349Chapter 27: Tempting C++ Templates . . . . . . . . . . . . . . . . . . . . . . . . . . .351Generalizing a Function into a Template...................................................353Template Classes..........................................................................................355Do I Really Need Template Classes? .........................................................358Tips for Using Templates ............................................................................361Chapter 28: Standardizing on the Standard Template Library . . . . . .363The string Container....................................................................................364The list Containers.......................................................................................366Iterators.........................................................................................................368Using Maps....................................................................................................371Part VI: The Part of Tens............................................375Chapter 29: Ten Ways to Avoid Adding Bugs to Your Program . . . . .377Enabling All Warnings and Error Messages ..............................................377Insisting on Clean Compiles........................................................................378

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!