C++ Programming - OOPS Concepts - Discussion

Discussion Forum : OOPS Concepts - General Questions (Q.No. 9)
9.
Which of the following cannot be friend?
Function
Class
Object
Operator function
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
21 comments Page 1 of 3.

Mouna said:   12 months ago
Thank you all for explaining.
(1)

Tammana karthikeya said:   4 years ago
Object cannot be defined as friend.
(2)

Vivek Roy said:   4 years ago
We can define a friend function (i.e a normal function can be a friend of a class or a member function of a class can be a friend function of another class), friend class (i.e member function of a friend class can directly access private and public members of that class, if which it is defined as friend) and also friend operator function (i.e operator function of one class can be defined as friend function in another class). But object is a run time entity.
(3)

Gyanendra Kumar namdev said:   7 years ago
Thanks for the explanation.

Aahan said:   8 years ago
Why not operator funtion?

Shubham said:   8 years ago
Instance of class means object works during the execution of program.

Manjusha said:   10 years ago
What is mean by instance of a class?

Adity pachory said:   10 years ago
Friend function is used to pass arguments in a class. Class can also be friend but an object is cannot be friend as it is an instance of a class.

Sowmya said:   10 years ago
Explain the friend function?

Aravind said:   1 decade ago
How is operator can be friend function explain in detail.


Post your comments here:

Your comments will be displayed after verification.