Create a Friend class that contains a first name, last name, a birthday, and a telephone number. Create a Contacts class that contains an array of Friend as well as the owner's name and cell phone Number.
void input_contacts_name(string f){//function to take contact name
f_name=f;
}
void input_contacts_name(string l){//function to take contact name
l_name=l;
}
void input_contacts_number(int x){//function to take contact number
tel_num=x;
}
void inut_contacts_birthday(int b){//function to take contact birthday
birthday=b;
}
}
1) Your problem description says that Contacts shoud contain an array of Friend. I don't see that anywhere in your Contacts class.
2) Why are you making all your data members public? That completely destroys encapsulation, which is one of the fundamental principle of OOP. If your data members are all public, then what's the point of using classes at all?
3) What sort of string are you using? The standard library std::string? If so, then f_name and l_name aren't pointers, so it's impossible to set them to NULL.
4) If you want to initialise integers to 0, then initialise them to 0. Don't try initialising them to NULL, because that's counterintuitive and confusing.
5) If you want to initialise your data members, use an initialisation list, rather than assigning values insde the constructor after they've been initialised to default values.
6) Your specification doesn't say anything about Contacts storing the owner's birthday, yet you've given Contacts a birthday data member.