Which of the following is a correct statement about friend functions in C++? 

  • They are member functions of a class 
  • They can be inherited by derived classes 
  • They always improve performance of the program 
  • They do not have access to the 'this' pointer of the class
In C++, the 'this' pointer is an implicit pointer to the object on which a member function is called. Since friend functions are not member functions of a class, they do not have access to this pointer. They operate as external functions with special access permissions.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *