#include #include using namespace std; struct coords { int x; int y; }; void printCoordP(coords *c) // Parameter is a pointer { cout << (*c).x << " " << c->y << endl; c->x++; // Does change c in main } void printCoordS(coords c) // Call-by-value { cout << c.x << " " << c.y << endl; c.x++; // Has no effect on c in main } void printCoordR(coords &c) // Call-by-reference { cout << c.x << " " << c.y << endl; c.x++; // Does change c in main } int main() { coords c; c.x = 1; c.y = 2; printCoordP(&c); printCoordS(c); printCoordR(c); printCoordS(c); return 0; }