What are friend classes?

S

Snyke

Hi.
I'm just wondering what friend classes/functions are.
It's because I stumbled across them while analyzing a source.
 
V

Victor Bazarov

Snyke said:
I'm just wondering what friend classes/functions are.
It's because I stumbled across them while analyzing a source.

If a function declared a friend you may access private members of
the class inside the body of that function. Declaring a whole class
a friend grants access to private members inside the scope of that
class.

Victor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top