can someone explain what my teacher means by this statement


In the overridden << operator code, print the base class data without calling a base class print method

I know we are working on derived classes.....
Your teacher means "violate good practice and instead use evil protected data members in the base class". In other words, your teacher wants you to write bad code. That is, unless there is some information you have left out. I can't read your mind, so I don't know what your code looks like.
Last edited on
closed account (48T7M4Gy)
Good or bad, I interpret the question as writing an overloaded operator << function instead of a print() method within the class.

That way, an object 'knows' how to print itself Eg cout << obj prints out the properties of obj.
Topic archived. No new replies allowed.