In terms of object-oriented design principles, what is typically the most significant critique against the use of friend functions? 

  • They break encapsulation. 
  • They increase execution time. 
  • They aren't necessary in OOP. 
  • They cause memory leaks.
Friend functions have the ability to access private and protected members of a class, which can be seen as a violation of the principle of encapsulation in object-oriented programming. While they offer flexibility, they can break the boundaries set by encapsulation.
Add your answer
Loading...

Leave a comment

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