fork download
  1. #include <stdio.h>
  2.  
  3. struct Op
  4. {
  5. const char *name;
  6. struct Op *parent;
  7. struct Op *children;
  8. };
  9.  
  10. static struct Op op_subops[4]; // fwd ref to children of ops
  11.  
  12. static struct Op ops[128] = {
  13. {"op",0,&op_subops[0]}
  14. };
  15.  
  16. static struct Op op_subops[] = {
  17. {"subop1",&ops[1],0},
  18. {"subop2",&ops[1],0}
  19. };
  20.  
  21. int main(void) {
  22. printf("%s", ops[0].children->name);
  23. // your code goes here
  24. return 0;
  25. }
  26.  
Success #stdin #stdout 0s 2168KB
stdin
Standard input is empty
stdout
subop1