Computer Science, asked by ananddhore90, 1 month ago

Which of the following allows to access the private data of the ot
her funtion ? Funtion main function

Answers

Answered by vyomgarg497
0

Answer:

Any member function of that class.

Explanation:

Accessing a data member depends only on the access control of that data member. If its public, then the data member can be easily accessed using the direct member access (.) operator with the object of that class.

If, the data member is defined as private or protected, then we cannot access the data variables directly. Then we will have to create special public member functions to access, use or initialize the private and protected data members.

These member functions are also called Accessors and Mutator methods or getter and setter functions.

Similar questions