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
1.4m articles
1.4m replys
5 comments
57.0k users