#include #include using namespace std; struct str { int f1; int f2; }; str s = {10, 20}; str f(); str *g(); str& h(); int main() { cout << "f().f1 == " << f().f1 << "\n" << "g()->f1 == " << g()->f1 << "\n" << "h().f1 == " << h().f1 << "\n"; g()->f1 = 30; //Change s.f1 to 30. Must use arrow. h().f1 = 40; //Change s.f1 to 40. Must use dot. return EXIT_SUCCESS; } str f() { return s; } str *g() { return &s; } str& h() { return s; }