Computer Science, asked by shambhupandit, 10 months ago

How to access a private member function
of a class?
(a) Using object of class
(5) Using object pointer
(c) Using a public member function
(d) Using class address​

Answers

Answered by WajahatWastii
1

Answer:

using a public member function

Explanation:

generally member functions are defined as public. but private members(functions in your case) can not be accessed outside the class. In order to access the private member function outside the class you have to define a public member function which is accessible outside the class and through which you can call the private member function.

Similar questions