| <<< Other constructors | Index | Array of objects and default constructor >>> |
You lose the implicit default constructor, if:
you add a constructor taking no arguments:
class Point {
public:
Point();
};
you add a constructor with all default arguments:
class Point {
public:
Point( int x = 0, int y = 0 );
};
you add a constructor taking one or more arguments:
class Point {
public:
Point( Point const* other );
};
int main()
{
Point pt; // ERROR: no default constructor!
return 0;
};
| <<< Other constructors | Index | Array of objects and default constructor >>> |