Polymorphism: Difference between revisions
Content deleted Content added
Line 59: | Line 59: | ||
int Point_getX(Point* pthis) { return pthis->x; } |
int Point_getX(Point* pthis) { return pthis->x; } |
||
int Point_getY(Point* pthis) { return pthis->y; } |
int Point_getY(Point* pthis) { return pthis->y; } |
||
int Point_setX(Point* pthis, int x0) { pthis->x = x0; } |
int Point_setX(Point* pthis, int x0) { pthis->x = x0; } |
||
int Point_setY(Point* pthis, int y0) { pthis->y = y0; } |
int Point_setY(Point* pthis, int y0) { pthis->y = y0; } |
||
void Point_print() { printf("Point\n"); } |
void Point_print() { printf("Point\n"); } |
||
void Point_vprint(Point* pthis) { pthis->print(); } |
void Point_vprint(Point* pthis) { pthis->print(); } |
||
Line 138: | Line 135: | ||
} |
} |
||
int Circle_getX(Circle* pthis) { return pthis->x; } |
|||
int Circle_getY(Circle* pthis) { return pthis->y; } |
|||
int Circle_getR(Circle* pthis) { return pthis->r; } |
int Circle_getR(Circle* pthis) { return pthis->r; } |
||
int Circle_setX(Circle* pthis, int x0) { pthis->x = x0; } |
|||
int Circle_setY(Circle* pthis, int y0) { pthis->y = y0; } |
|||
int Circle_setR(Circle* pthis, int r0) { pthis->r = r0; } |
int Circle_setR(Circle* pthis, int r0) { pthis->r = r0; } |
||
void Circle_print() { printf("Circle\n"); } |
void Circle_print() { printf("Circle\n"); } |