include <iostream>
usingnamespace std;
class dividebyzero{
public:
dividebyzero();
void printmessage();
private:
constchar* message;
};
//I dont understand this function syntax. Why : message() is added?
dividebyzero::dividebyzero() : message(“Divide by Zero”)
{ /* nothing else needs to be done */}void
dividebyzero::printmessage(){
cout << message << endl;}
The above code constructs each of member1, member2, member3 via their default constructors, and then after that calls their assignment operators with each of param1, param2, param3. It is less efficient by far.