displaying multiple class objects STUCK

I cannot figure out why the void magazine::magDisplay definition is not working.

-------Class Definition--------
class magazine{
friend class Date;
friend class Person;
private:
person subscriber;
date subStart;
date subExpire;
public:
magazine(person subscriber, date subStart, date subExpire);
void magDisplay();
};

--------Date class definition--------

class date{
private:
int month, day, year;
public:
date(int month, int day, int year);
date() : month(1), day(1), year(2000) {}
void showDate();
};

--------Person class definition-------
class person{
private:
string lname, fname, zcode;
public:
person() : lname("X"), fname("X"), zcode("X") {}
person(string lname, string fname, string zcode);
void showPerson();
};

---------magazine member function definition----------

void magazine::magDisplay(){
cout << "\n Subscriber name: " << subscriber << "\n Start date: " << subStart << "\n End date: " << subExpire;
}
Last edited on
what error messages are you getting? is the << operator suitably overloaded for date and Person classes?
considering you are quite new...

here some article

http://www.cplusplus.com/articles/jEywvCM9/
Topic archived. No new replies allowed.