Structures and Functions
Passing Structures to Functions
struct Point { int x; int y; }; void displayPoint(struct Point p) { printf("Point: (%d, %d)\n", p.x, p.y); }
Returning Structures from Functions
struct Point createPoint(int xVal, int yVal) { struct Point newPoint; newPoint.x = xVal; newPoint.y = yVal; return newPoint; }