2006-02-09から1日間の記事一覧

継承?

#include typedef struct _parent { int x; } parent;typedef struct _child { int x; int y; } child;int main() { parent *p; child c; c.x = 10; c.y = 20; p = (parent*) &c; printf("%d\n", p->x); return 0; }継承になるのかなぁ…