Overload operator in subclass

前端 未结 2 1804
梦毁少年i
梦毁少年i 2021-01-07 12:22

tour and guided tour. Guided tour extends the tour class. I\'m overloading << and >> operators in the tour class.

My tour class looks like

#inc         


        
2条回答
  •  余生分开走
    2021-01-07 12:46

    If i understood right, you have pointers in your vector. So you should use key word virtual. And read about virtual methods in C++.

提交回复
热议问题