C

#include <stdio.h> typedef struct { int x, y; } Point; void doubleIt( Point * p ) { p->x = p->x * 2; p->y = p->y * 2; } void printIt( const Point * p) { printf("{%d, %d}\n", p->x, p->y); } int main() { Point p1, p2; Point pa[4]; int n; p1.x = 1; p1.y = 1; p2.x = 0; p2.y = 2; // accessing p1 printIt( &p1); doubleIt(&p1); printIt( &p1); // accessing p2 printIt( &p2); doubleIt(&p2); printIt( &p1); // accessing the pa array for (n = 0; n<4; ++n) { pa[n].x = n; pa[n].y = -n; printIt(&pa[n]); doubleIt(&pa[n]); printIt(&pa[n]); } }