How to make a derived class access the private member data?

前端 未结 5 954
忘掉有多难
忘掉有多难 2021-02-06 03:42

I\'m stuck with a c++ problem. I have a base class that has a self referential object pointer inside the private visibility region of the class. I have a constructor in the base

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-06 04:11

    try to give protected as the access specifier in base class and inherit the base class in private mode.....but for further using member functions of base class u may need few short inline functions as they will also be converted to private

提交回复
热议问题