In a class, the private data can be accessed only by the public member function of that class. c++ provides a mechanism in which a non member can have access to the private member of a class. This is achieved by the non_member function "friend" to the class, whose private data can be accessed.