Hi guys,
Came upon a syntactic problem, and looking for a little help.
I have two classes, Patient which is derived from Person;
1 2 3 4 5 6 7 8 9
|
class Patient:public Person{
public:
void input();
void print();
};
|
Then I have this class
1 2 3 4 5 6 7
|
class Person{
friend std::istream& operator>>(std::istream& input, Person& the_person);
};
|
Now, if the Person class had a function called...
Inside the Patient class, I could do this...
1 2 3 4 5 6 7 8 9 10
|
Patient::input(){
Person::input();
/*
more code here
*/
}
|
However, since Person is using overloading, I am not sure how to syntactically make it work.
So my question is, inside of the Patient::input() function, how do I "input" a person using the overloaded >> operator.
Any help would be greatly appriciated. Of course I could just cheap out and not use the >> operator, but I am trying to learn new techniques.
Thanks a lot,
Mike