Friend function: Difference between revisions

Content deleted Content added
Removed unfinished sentence (quite surprised no one noticed this, it's been a month since the last edit)
Line 10:
This approach may be used in friendly function when a function needs to access private data in objects from two different classes.
This may be accomplished in two similar ways
*a function of global or [[namespace]] scope may be declared as friend of both classesclas may be declared as friend of another one.
*a member function of one class may be declared as friend of another one.
<source lang=Cpp>
#include <iostream>