Lets say I have the following class in my dll
class Test { private: int x; };
and following function in client side application which uses my dll
void test();
Is there a way to make test function friend for Test class?
CodePudding user response:
Is there a way to make test function friend for Test class?
Yes, add a friend
declaration to the class definition:
class Test {
private:
int x;
friend void test();
};