// 24T3 COMP1511 Week 5 Lecture 2 // variables/data are passed into functions by value // a copy of the value gets passed into the function // TO DO MODIFY THIS TO USE POINTERS #include struct point { int x; int y; }; void update(struct point *p); int main(void) { struct point p; p.x = 10; p.y = 9; update(&p); printf("(%d,%d)\n", p.x, p.y); return 0; } // This function will only modify the local copy of p // FIX TO USE POINTERS void update(struct point *p) { p->x = p->x + 1; p->y = p->y + 1; }