#include <iostream> #include <string> using namespace std; class Stank{ public: Stank(){ stink=0; } private: int stink; friend void stinkfr(Stank &sfo); }; void stinkfr(Stank &sfo){ sfo.stink = 99; cout << sfo.stink << endl; } int main() { Stank bob; stinkfr(bob); }
C++ | Friends :')
Why have people friends, when you can have function friends?