0

Hi all,

I have two classes C and D these classes are inherited from B class. My question is how can I use a member function of C at D and at D's child classes? I tried to do it with a regular function but it does not work in class definitions. I also tried friends and it does not work. If you can provide your reply with an example I will be grateful.
I appreciate for helps,

Thanks,

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by esesili
0

>> My question is how can I use a member function of C at D and at D's child classes?
I don't understand that sentence. Can you elaborate or show what you mean with a simple example that shows what you want to do even if it doesn't work?

0

I have doctor class and patient class, these two of them are inherited from person class. The doctor class has a member function "double get_fee_of_doc() const;" it returns a double value. I want to use this double value in a member function of patient class to make a very simple calculation. So my question is how can I call or use the value returned from double get_fee_of_doc() const;? If this information is not enough please let me know to post a portion of codes.
Thanks a lot,

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.