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 definition
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
2.1m questions
2.1m answers
60 comments
57.0k users