Accelerated C++: Practical Programming by Example (Paperback)
Andrew Koenig, Barbara E. Moo
Accelerated C++ introduces a radical new approach to teaching C++. It starts with the most useful concepts rather than the most primitive ones, so the student can begin writing programs immediately. It describes real problems and solutions, not just language features. And it includes the standard library from the start. The authors proved the effectiveness of this approach in their courses at Stanford and Princeton, where their students learned to write substantial programs their first day in the classroom.
0. Getting Started.
The Main Function.
Using the Standard Library for Output.
The Return Statement.
A Slightly Deeper Look.
1. Working with Strings.
Framing a Name.
2. Looping and Counting.
Writing an Unknown Number of Rows.
Writing a Row.
The Complete Framing Program.
3. Working with Batches of Data.
Using Medians Instead of Averages.
4.Organizing Programs and Data.
Putting it All Together.
Partitioning the Grading Program.
The Revised Grading Program.
5. Using Sequential Containers and Analyzing Strings.
Using Iterators Instead of Indices.
Rethinking Our Data Structure for Better Performance.
The List Type.
Taking Strings Apart.
Testing Our Split Function.
Putting Strings Together.
6. Using Library Algorithms.
Comparing Grading Schemes.
Classifying Students, Revisited.
Algorithms, Containers, and Iterators.
7. Using Associative Containers.
Generating a Cross-Reference Table.
A Note on Performance.
8. Writing Generic Functions.
Input and Output Iterators.
Using Iterators for Flexibility.
9. Defining New Types.
The Student_info class.
Using the Student_info class.
10. Managing Memory and Low-Level Data Structures.
String Literals Revisited.
Initializing Arrays of Character Pointers.
Arguments to Main.
Reading and Writing Files.
Three Kinds of Memory Management.
11. Defining Abstract Data Types.
Implementing the Vec Class.
Flexible Memory Management.
12. Making Class Objects Act Like Values.
Some Conversions are Hazardous.
Conversions and Memory Management.
13. Using Inheritance and Dynamic Binding.
Polymorphism and Virtual Functions.
Using Inheritance to Solve Our Problem.
A Simple Handle Class.
Using the Handle Class.
14. Managing Memory (Almost) Automatically.
Handles that Let you Decide When to Share Data.
An Improvement on Controllable Handles.
15. Revisiting Character Pictures.
16. Where Do We Go From Here?
Appendix A. Language Details.
Appendix B. Library Summary.
Containers and Iterators.