Is it possible to access private members of a class?

前端 未结 4 1272
既然无缘
既然无缘 2020-12-06 21:14

Is it possible to access private members of a class in c++.

provided you don\'t have a friend function and You don\'t have access to the class def

4条回答
  •  旧时难觅i
    2020-12-06 21:54

    You mean using some pointer arithmetic to gain the access ? It is possible but is definitely dangerous. Take a look at this question also: Accessing private members

提交回复
热议问题