C++ Friend Question:

Download Job Interview Questions and Answers PDF

Explain the characteristics of friend functions?

C++ Friend Interview Question
C++ Friend Interview Question

Answer:

A friend function is not in the scope of the class n which it has been declared as friend.
It cannot be called using the object of that class.
It can be invoked like a normal function without any object.
Unlike member functions, it cannot use the member names directly.
It can be declared in public or private part without affecting its meaning.
Usually, it has objects as arguments.

Download C++ Friend Interview Questions And Answers PDF

Previous QuestionNext Question
Explain advantages of using friend classes?What is a friend function?