C Books Guide and List
C++ Books Guide and List
Best Java Books

3,749 questions

4,049 answers

114 comments

10,705 users

How can we access protected and private members of a class?

0 votes
19 views
asked Jan 1, 2014 by smith Geek (15,340 points)

1 Answer

0 votes
In the case of members protected and private, these could not be accessed from outside the same

class at which they are declared. This rule can be transgressed with the use of the friend keyword in a

class, so we can allow an external function to gain access to the protected and private members of a class.
answered Jan 1, 2014 by rajesh Guru (39,140 points)

Related questions

0 votes
1 answer 25 views
25 views asked Dec 31, 2013 by smith Geek (15,340 points)
0 votes
1 answer 11 views
11 views asked Dec 29, 2013 by john Guru (27,140 points)
0 votes
1 answer 30 views
0 votes
1 answer 39 views
39 views asked May 11, 2014 by rock Expert (14,990 points)
0 votes
1 answer 45 views
...