C++ Programming - Objects and Classes - Discussion

Discussion Forum : Objects and Classes - General Questions (Q.No. 11)
11.
Which of the following can access private data members or member functions of a class?
Any function in the program.
All global functions in the program.
Any member function of that class.
Only public member functions of that class.
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
5 comments Page 1 of 1.

Ron said:   9 years ago
Private data & functions can be accessed using only the public member functions of that class.

Shilpi said:   9 years ago
Private members are access by only public member functions of that class.

BALA said:   1 decade ago
Private member of a function or variable can be access through public members of that class only.

Ashu said:   1 decade ago
Private members of a class can only be access through public members of that class.

Abhiramnaresh said:   1 decade ago
Private data members or member functions can only access through the same member of that class.

If it is public we can access it from any class.

Post your comments here:

Your comments will be displayed after verification.