#include #include using namespace std; struct str { int i; double d; }; void f(str *p); int main() { str s = {10, 3.14}; //don't need the keyword "struct" cout << s.i << " " << s.d << "\n"; str *p = &s; //Let the value of p be the address of s. cout << (*p).i << " " << (*p).d << "\n" << p->i << " " << p->d << "\n"; f(p); return EXIT_SUCCESS; } void f(str *p) { cout << p->i << " " << p->d << "\n"; }