fork download
  1. #include <stdio.h>
  2. #include <stdint.h>
  3. #include <stdlib.h>
  4.  
  5. typedef struct word{
  6. struct word *previous;
  7. char *name;
  8. uint8_t flag;
  9. void(*xt)();
  10. } word;
  11.  
  12. int main(void)
  13. {
  14. word* root = malloc(sizeof(word));
  15. *root = (word){ 0, "plus", 0, 0 };
  16.  
  17. word* prev = root;
  18. root = malloc(sizeof(word));
  19. *root = (word){ prev, "minus", 0, 0 };
  20.  
  21. prev = root;
  22. root = malloc(sizeof(word));
  23. *root = (word){ prev, "times", 0, 0 };
  24.  
  25. for (word* curr = root; curr; curr = curr->previous)
  26. printf("%s\n", curr->name);
  27. return 0;
  28. }
  29.  
Success #stdin #stdout 0s 2300KB
stdin
Standard input is empty
stdout
times
minus
plus