Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void *foo_vtable;
- struct Foo
- {
- void *vtable;
- int truc;
- }
- struct Foo* init_foo()
- {
- Foo *f = malloc(sizeof(*f));
- f->vtable = foo_vtable;
- }
- int main()
- {
- foo_vtable = malloc(x * sizeof(void*));
- foo_vtable[0] = (void*)&foo_func;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement