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 2 of 3.

Arpit said:   1 decade ago
Object is a variable of class type hence there is no sense to declare it as a friend. If it is declared as friend then where we use it think about it. Even if we make use of function as friend then it can be used to access other class private data.

Nirmala said:   1 decade ago
I don't know whether it is correct. The operator functions are used in the concept of operator overloading and type conversion. Operator can be overloaded as a member function or friend function. Therefore an operator function can be a friend function.

Kamal said:   1 decade ago
What is operator function?

Amolbendale said:   1 decade ago
How you can say that operator function is a friend function?

K.soundarya rao said:   1 decade ago
Any type of function can be made friendly exception-static. But object are the instance of class that cannot be made friend.

Sanket said:   1 decade ago
How can operator function be friend function?even I didn't get it?

Saba said:   1 decade ago
How can operator function be a FRIEND FUNCTION?

Jyoti shankar chaubey said:   1 decade ago
How you can say that operator function is a friend function?

Supreet kaur said:   1 decade ago
Friend function is a function which is not the member of the class but take part in class to pass arguments. Similarly a class can be a friend but an object cannot because it is an instance of the class.

Surya joy said:   1 decade ago
Objects cannot be defined as friend by a user since it is just instance of a class.


Post your comments here:

Your comments will be displayed after verification.