Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
friend function
//g++ 5.4.0 #include <iostream> using namespace std; //before declaration of ONE. class ONE; class TWO { public: void print(ONE &x); }; class ONE { int a, b; friend void TWO::print(ONE &x); public: ONE() : a(1), b(2) { } }; void TWO::print(ONE &x) { cout << "a is " << x.a << endl; cout << "b is " << x.b << endl; } int main() { ONE xobj; TWO yobj; yobj.print(xobj); }
run
|
edit
|
history
|
help
0
string-Orderly words
void sun()
Templet
IviewwithSelf
nearest
runtime template mode processor
euler tour (by pure theory)
Test 9(2021)
Triplet sum in array
Exploring the Transform Function and Operator Classes