mardi 18 avril 2017

How to call a function from one class in a different class

I am making a program that is formed by 2 header files. One is called contact.h, which contains a class Contact with 2 children classes; email and phone number. Both of the children classes have a function set_contact() and print().

The other header file is called Person.h and contains a class Person. A function void print(); is supposed to use the print function for both email and phone number from the contact class.

How can I implement those functions inside of the print() function for class Person?


0 commentaires:

Enregistrer un commentaire