Pergunta de entrevista da empresa MathWorks

What are friend functions?

Respostas da entrevista

Sigiloso

17 de dez. de 2013

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

1

Sigiloso

22 de mar. de 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.