I know it's possible to create a friend function in C++:
class box
{
friend void add(int num);
private:
int contents;
};
void add(int num)
{
box::contents = num;
return;
}
But is there a way to create friend classes?
NB: I know there are probably a lot of errors in this code, I don't use friend functions and am still pretty new to the language; if there are any, please tell me.