fork(3) download
  1. #include <stdio.h>
  2.  
  3. typedef struct A A_t;
  4.  
  5. struct A{
  6. void (*f1)(A_t* self);
  7. void (*f2)(A_t* self);
  8.  
  9. int dat1;
  10. int dat2;
  11. };
  12.  
  13. void func1(A_t* a) {}
  14. void func2(A_t* a) {}
  15.  
  16. A_t const1()
  17. {
  18. A_t l = {func1, func2, 0, 0};
  19. return l;
  20. }
  21.  
  22.  
  23. int main(void) {
  24. // your code goes here
  25. A_t a = const1();
  26. a.f1(&a);
  27. return 0;
  28. }
  29.  
Success #stdin #stdout 0s 9296KB
stdin
Standard input is empty
stdout
Standard output is empty