hi, i took this example from a previous post of another user.. whe i try to run it i get a compile error saying : "default argument missing for parameter 2 of People "... line 19.. I dont understand why const Birthday& b is not a valid argument. any help appreciated. thanks
class Birthday
{
public:
Birthday(int d = 1, int m = 1, int y = 1900) : day(d), month(m), year(y) {}; // constructor
Birthday(const Birthday& other) // copy contructor
{
day = other.day;
month = other.month;
year = other.year;
}
private:
int day;
int month;
int year;
};
class People
{
public:
People(string n = "", const Birthday& b = Birthday()) : name(n), dob(b) {}; // constructor
private:
string name;
Birthday dob;
};