C++ Programming - Objects and Classes - Discussion

Discussion Forum : Objects and Classes - General Questions (Q.No. 9)
9.
Which of the following statement is correct with respect to the use of friend keyword inside a class?
A private data member can be declared as a friend.
A class may be declared as a friend.
An object may be declared as a friend.
We can use friend keyword as a class name.
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
4 comments Page 1 of 1.

Divya said:   8 years ago
Yeah, I agree @Mohini.

Uma said:   8 years ago
Friend is a keyword used for accessing the functions but how can we use it for class?

Mohini said:   1 decade ago
Private member can't declared friend as friend is use to make accessible through another class but private has scope in own class only. But a class may be declared as friend.

Bunny said:   1 decade ago
How can we do it? is it possible to declare a class as friend inside a class?

Post your comments here:

Your comments will be displayed after verification.