Answer:
The Point class has a default constructor that does not initialize the mx and my member variables. To implement the default constructor using the initializer list, you can add the member variable names to the initializer list and specify their initial values, as shown below:
// point.cpp
#include "point.h"
Point::Point() : mx(0), my(0)
{
// body is empty
}
This implementation of the default constructor initializes the mx and my member variables to 0 using the initializer list. This means that when a Point object is created using this constructor, the mx and my member variables will be initialized to 0 by default.
The updated point.h file is shown below:
// point.h
#ifndef POINT H
#define POINT H
class Point
{
public:
Point();
private:
int mx; // 0,0
int my;
};
#endif
With this implementation, the default constructor for the Point class correctly initializes the mx and my member variables using the initializer list.