Combining Constructors
In C++, you cannot invoke one constructor form within another.
class box { // error -- does not work as expectedpublic: box (int i) : x(i) { } box (int i, int j) : y(j) { box::box(i); } int x, y;
};
Previous slide
Next slide
Back to first slide
View graphic version