April 2011
Beginner
624 pages
11h 34m
English
One of the themes in this book is that object orientation is a way to create fundamental new data types—types that, if useful enough, can be reused in multiple programs.
The promise that you can make classes as convenient as standard data types has yet to be fulfilled. One of the most important features of types such as int, float, double, and so on, is that you can initialize them as you declare them.
But you’re about to see how to do that with classes. Welcome to the craft of C++ construction.
The term constructor is C++-speak for an initialization function, specifically, I mean functions that tell the compiler how to interpret declarations like this:
Fraction a(1, 2); // a = ...
Read now
Unlock full access