Computer Science - Object Oriented Programming Using C++ - Discussion

Discussion Forum : Object Oriented Programming Using C++ - Section 7 (Q.No. 5)
5.
The program can access the private members of a class
directly
only through other private members of the class
only through other public members of the class
None of the above - the program cannot access the private members of a class in any way
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
3 comments Page 1 of 1.

Niranjan said:   3 years ago
The class members declared as private can be accessed only by the member functions inside the class.

They are not allowed to be accessed directly by any object or function outside the class. Only the member functions or the friend functions are allowed to access the private data of members of the class.

Geetha said:   7 years ago
I think the option is 'B'.

Sangeeta said:   8 years ago
How it is possible.?

We can not access private members of a class through public members.

Post your comments here:

Your comments will be displayed after verification.