123456789101112131415161718192021222324252627282930 |
- #include <stdio.h>
- typedef struct {
- int x;
- int y;
- } Point;
- void setxy(Point *point, int new_x, int new_y) {
- point->x = new_x;
- point->y = new_y;
- }
- void displayxy(Point point) {
- printf("(%d,%d)", point.x, point.y);
- }
- int main() {
- Point point1 = {3, 4};
- Point point2 = {5, 6};
- printf("The first point is:");
- displayxy(point1);
- printf("\n");
- printf("The second point is:");
- displayxy(point2);
- printf("\n");
- return 0;
- }
|