Thinking in C++, 2nd edition is a book for readers to master C++, laden with expert advice and written in a clear and knowledgeable style.
Eckel starts with a detailed look at objects, showing how C++ programs can be constructed from off-the-shelf object libraries. This edition includes a new, chapter-length overview of the C features that are used in C++
- Introduction to Objects – introduces the reader to the basic concepts of object-oriented programming (OOP), including an overview of OOP development methods
- Making & Using Objects – introduces enough C++ syntax and program construction concepts to allow you to write and run some simple object-oriented programs
- The C in C++ – covers the basic syntax of C and C++ in detail. This chapter is a fairly fast coverage of C constructs and introduction to some basic C++ constructs
- Data Abstraction – takes all the scattered components of a typical C library and encapsulates them into a structure (an abstract data type, called a class)
- Hiding the Implementation – looks at the subject of boundaries in structures
- Initialization & Cleanup – additional features that have been engineered into C++ that make the bugs in your program almost leap out and grab you
- Function Overloading & Default Arguments – the theme of this chapter is convenient use of function names
- Constants – the concept of constant (expressed by the const keyword) was created to allow the programmer to draw a line between what changes and what doesn’t. This provides safety and control in a C++ programming project
- In-line Functions – retains the efficiency of the preprocessor macro, but adds the safety and class scoping of true functions. This chapter looks at the problems of preprocessor macros in C++, how these problems are solved with in-line functions, and guidelines and insights on the way inlines
- Name Control – learn how static controls storage and visibility, and an improved way to control access to names via C++’s namespace feature. The reader also finds out how to use functions that were written and compiled in C
- References & the Copy-Constructor – looks briefly at the differences between pointers in C and C++, then introduces references. The copy-constructor, a special constructor (requiring references) that makes a new object from an existing object of the same type. The copy-constructor is used by the compiler to pass and return objects by value into and out of functions.
- Operator Overloading – over-loadable operators: unary operators, binary operators, unusual operators, and more
- Dynamic Object Creation – learn how C++’s new and delete elegantly solve this problem by safely creating objects on the heap
- Inheritance & Composition – learn about code reuse mechanisms
- Polymorphism & Virtual Functions – polymorphism (implemented in C++ with virtual functions) is the third essential feature of an object-oriented programming language, after data abstraction and inheritance
- Introduction to Templates – the template feature in C++ provides a way to reuse source code
Every chapter contains many modular, to-the-point examples, plus exercises based on Eckel’s extensive experience teaching C++ seminars.
The electronic version of the book will continue to be free, even after it’s published. You have permission to print a copy of the book for your own use.