Introduction -- What's in this book -- What's on the CD -- What is C++? -- Conventions used in this book -- How this book is organized -- And there's more -- Part 1: Introduction to C++ programming -- Chapter 1: Writing your first C++ program -- Grasping C++ concepts -- Installing code::Blocks -- Creating your first C++ program -- Creating a project -- Entering the C++ code -- Cheating -- Building your program -- Executing your program -- Reviewing the annotated program -- Examining the framework for all C++ programs -- Clarifying source code with comments -- Basing programs on C++ statements -- Writing declarations -- Generating output -- Calculating expressions -- Storing the results of an expression -- Examining the remainder of conversion -- Chapter 2: Declaring variables constantly -- Declaring variables -- Declaring different types of variables -- Reviewing the limitations of integers in C++ -- Solving the truncation problem -- Looking at the limits of floating-point numbers -- Declaring variable types -- Types of constants -- Range of numeric types -- Special characters -- Wide loads on char highway -- Are these calculations really logical? -- Mixed mode expressions -- Automatic declarations -- Chapter 3: Performing mathematical operations -- Performing simple binary arithmetic -- Decomposing expressions -- Determining the order of operations -- Performing unary operations -- Using assignment operators -- Chapter 4: Performing logical operations -- Why mess with logical operations? -- Using the simple logical operators -- Storing logical values -- Using logical int variables -- Be careful performing logical operations on floating-point variables -- Expressing binary numbers -- Decimal number system -- Other number systems -- Binary number system -- Performing bitwise logical operations -- Single-bit operators -- Using the bitwise operators -- Simple test -- Do something logical with logical calculations -- Chapter 5: Controlling program flow -- Controlling program flow with the branch commands -- Executing loops in a program -- Looping while a condition is true -- Using the autoincrement/autodecrement feature -- Using the for loop -- Avoiding the dreaded infinite loop -- Applying special loop controls -- Nesting control commands -- Switching to a different subject? --
Part 2: Becoming a functional C++ programmer -- Chapter 6: Creating functions -- Writing and using a function -- Defining our first function -- Defining the sumSequence0 function -- Calling the function sumSequence0 -- Divide and conquer -- Understanding the details of functions -- Understanding simple functions -- Understanding functions with arguments -- Overloading function names -- Defining function prototypes -- Variable storage types -- Chapter 7: Storing sequences in arrays -- Arraying the arguments for arrays -- Using an array -- Initializing an array -- Accessing too far into an array -- Using arrays -- Defining and using arrays of arrays -- Using arrays of characters -- Creating an array of characters -- Creating a string of characters -- Manipulating strings with character -- Adding some library functions -- Making room for wide strings -- Chapter 8: Taking a first look at C++ pointers -- Variable size -- What's in an address? -- Address operators -- Using pointer variables -- Using different types of pointers -- Passing pointers to functions -- Passing by value -- Passing pointer values -- Passing by reference -- Constant const irritation -- Making use of a block of memory called the heap -- Limited scope -- Examining the scope problem -- Providing a solution using the heap -- Chapter 9: Taking a second look at C++ pointers -- Defining operations on pointer variables -- Reexamining arrays in light of pointer variables -- Applying operators to the address of an array -- Expanding pointer operations to a string -- Justifying pointer-based string manipulation -- Applying operators to pointer types other than char -- Contrasting a pointer with an array -- When is a pointer not? -- Declaring and using arrays of pointers -- Utilizing arrays of character strings -- Accessing the arguments to main0 -- Chapter 10: The C++ preprocessor -- What is a preprocessor? -- Including files -- #Defining things -- Okay, how about not #defining things? -- Enumerating other options -- Including things #if I say so -- Intrinsically defined objects -- Typedef -- Part 3: Introduction to classes -- Chapter 11: Examining object-oriented programming -- Abstracting microwave ovens -- Preparing functional nachos -- Preparing object-oriented nachos -- Classifying microwave ovens -- Why classify? -- Chapter 12: Adding class to C++ -- Introducing the class -- The format of a class -- Accessing the members of a class -- Activating our objects -- Simulating real-world objects -- Why bother with member functions? -- Adding a member function -- Calling a member function -- Accessing other members from a member function -- Scope resolution (and I don't mean how well your microscope works) -- Defining a member function in the class -- Keeping a member function after class -- Overloading member functions -- Chapter 13: Point and stare at objects -- Declaring arrays of objects -- Declaring pointers to objects -- Dereferencing an object pointer -- Pointing toward arrow pointers -- Passing objects to functions -- Calling a function with an object value -- Calling a function with an object pointer -- Calling a function by using the reference operator -- Why bother with pointers or references? -- Returning to the heap -- Allocating heaps of objects -- Comparing pointers to references -- Linking up with linked lists -- Performing other operations on a linked list -- Hooking up with a LinkedListData program -- A ray of hope: a list of containers linked to the C++ library --
Chapter 14: Protecting members: do not disturb -- Protecting members -- Why you need protected members -- Discovering how protected members work -- Making an argument for using protected members -- Protecting the internal state of the class -- Using a class with a limited interface -- Giving nonmember functions access to protected members -- Chapter 15: Why do you build me up, just to tear me down baby? -- Creating objects -- Using constructors -- Constructing a single object -- Constructing multiple objects -- Constructing a duplex -- Dissecting a destructor -- Why you need the destructor -- Working with destructors -- Chapter 16: Making constructive arguments -- Outfitting constructors with arguments -- Using a constructor -- Placing too many demands on the carpenter: overloading the constructor -- Defaulting default constructors -- Constructing class members -- Constructing a complex data member -- Constructing a constant data member -- Reconstructing the order of construction -- Local objects construct in order -- Static objects construct only once -- All global objects construct before main0 -- Global objects construct in no particular order -- Members construct in the order in which they are declared -- Destructors destruct in the reverse order of the constructors -- Constructors as a form of conversion -- Chapter 17: Copying the copy copy copy constructor -- Copying an object -- Why you need the copy constructor -- Using the copy constructor -- The automatic copy constructor -- Creating shallow copies versus deep copies -- It's a long way to temporaries -- Avoiding temporaries, permanently -- Chapter 18: Static members: can fabric softener help? -- Defining a static member -- Why you need static members -- Using static members -- Referencing static data members -- Uses for static data members -- Declaring static member functions -- What is this about anyway? -- Part 4: Inheritance -- Chapter 19: Inheriting a class -- Do I need my inheritance? -- How does a class inherit? -- Using a subclass -- Constructing a subclass -- Destructing a subclass -- Having a HAS_A relationship -- Chapter 20: Examining virtual member functions: are they for real? -- Why you need polymorphism -- How polymorphism works -- When is virtual function not? -- Considering virtual considerations -- Chapter 21: Factoring classes -- Factoring -- Implementing abstract classes -- Describing the abstract class concept -- Making an honest class out of an abstract class -- Passing abstract classes -- Part 5: Optional features -- Chapter 22: A new assignment operator, should you decide to accept it -- Comparing operators with functions -- Inserting a new operator -- Creating shallow copies is a deep problem -- Overloading the assignment operator -- Overloading the subscript operator -- Chapter 23: Using stream I/O -- How stream I/O works -- Default stream objects -- Stream input/output -- Open modes -- Hey, file, what state are you in? -- Can you show me an example? -- Other methods of the stream classes -- Reading and writing streams directly -- Controlling format -- What's up with endl? -- Positioning the pointer within a file -- Using the stringstream subclasses -- Manipulating manipulators -- Chapter 24: Handling errors-exceptions -- Justifying a new error mechanism? -- Examining the exception mechanism -- What kinds of things can I throw? -- Just passing through -- Chapter 25: Inheriting multiple inheritance -- Describing the multiple inheritance mechanism -- Straightening out inheritance ambiguities -- Adding virtual inheritance -- Constructing the objects of multiple inheritance -- Voicing a contrary opinion -- Chapter 26: Tempting C++ templates -- Generalizing a function into a template -- Template classes -- Tips for using templates -- Chapter 27: Standardizing on the standard template library -- The string container -- Iterating through lists -- Making your way through a list -- Operations on an entire list -- Can you show me an example? --
Chapter 28: Ten ways to avoid adding bugs to your program
Enable all warnings and error messages
Adopt a clear and consistent coding style
Comment your code while you write it
Single-step every path at least once
Avoid overloading operators
Manage the heap systematically
Use exceptions to handle errors
Declare destructors virtual
Avoid multiple inheritance
Chapter 29: Ten major recent additions to C++
Initialize variables with a variable-length list
Initialize data members inline
Instantiate an extern template
Implement thread local storage
Define variadic templates
What you'll find on the CD
Code::Blocks development environment