Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. void *foo_vtable;
  2.  
  3. struct Foo
  4. {
  5.  void *vtable;
  6.  int truc;
  7. }
  8.  
  9. struct Foo* init_foo()
  10. {
  11.  Foo *f = malloc(sizeof(*f));
  12. f->vtable = foo_vtable;
  13. }
  14.  
  15.  
  16. int main()
  17. {
  18.  foo_vtable = malloc(x * sizeof(void*));
  19. foo_vtable[0] = (void*)&foo_func;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement