class Date
{
public:
// Constructor goes here
int Day;
int Month;
int Year;
// additional members
};
class Appointment
{
public:
// Constructor goes here
char *Name;
char *Description;
int Priority;
void PrintDate();
// additional members...
};
I want the class 'Appointment' to be linked to 'Date' in such a way that I can create instances of 'Appointment' associated to instances of 'Date' and access the members of this parent instance; for example, retrieving the day of the appointment etc.
Although I'd like to point out that in real life, a date is a property of an appointment. So based on that train of thought it makes sense to give your 'Appointment' class an instance of your 'Date' class as a member.
This one comes down to how you have the rest of your program structured I guess.