/* * Code example for CP264 Data Structures II * return structure * HBF */ #include typedef struct { int x; int y; } POINT; POINT point_inc(POINT p) { p.x = p.x+1; p.y = p.y+1; return p; } void display(POINT p) { printf("%d,%d\n", p.x, p.y); } void main() { POINT p1={2,3}; display(p1); POINT p2 = point_inc(p1); display(p2); } /* 2,3 3,4 */