<<<Index>>>

Rules for implicit default constructors


  • 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 );
};
void main()
{
    Point pt; // Error: no default constructor:
}
<<<Index>>>