Skip to content

Instantly share code, notes, and snippets.

@akrennmair
Created April 23, 2012 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akrennmair/2473690 to your computer and use it in GitHub Desktop.
Save akrennmair/2473690 to your computer and use it in GitHub Desktop.
typedef struct {
int foo, bar;
} A;
typedef struct {
A super;
int baz;
} B;
void a_foobar(A * this) {
// ...
}
int main(void) {
A a;
B b;
a_foobar(&a);
a_foobar((A*)&b);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment