You are viewing a single comment's thread. Return to all comments →
ostream& operator<<( ostream& os, const Person& obj ) { string first_name, last_name; first_name = static_cast(obj).get_first_name(); last_name = static_cast(obj).get_last_name(); os << "first_name=" << first_name << ","<< "last_name=" << last_name << ""; return os; }
Seems like cookies are disabled on this browser, please enable them to open this website
Overloading Ostream Operator
You are viewing a single comment's thread. Return to all comments →
ostream& operator<<( ostream& os, const Person& obj ) { string first_name, last_name; first_name = static_cast(obj).get_first_name(); last_name = static_cast(obj).get_last_name(); os << "first_name=" << first_name << ","<< "last_name=" << last_name << ""; return os; }