Domanda di colloquio di MathWorks

What are friend functions?

Risposte di colloquio

Anonimo

17 dic 2013

A function that is declared to be the 'friend' of a class will have access to its private and protected data.

1

Anonimo

22 mar 2016

In object-oriented programming, a friend function that is a "friend" of a given class is allowed access to private and protected data in that class that it would not normally be able to as if the data was public . Normally, a function that is defined outside of a class cannot access such information.