C++ inheritance - inaccessible base?

后端 未结 2 1126
梦谈多话
梦谈多话 2020-11-28 05:15

I seem to be unable to use a base class as a function parameter, have I messed up my inheritance?

I have the following in my main:

int some_ftn(Foo          


        
2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-28 05:47

    By default, inheritance is private. You have to explicitly use public:

    class Bar : public Foo

提交回复
热议问题