fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. struct list {
  5. int key;
  6. struct list *next;
  7. };
  8.  
  9. struct list *append(struct list **l1, int k)
  10. {
  11. *l1 = malloc(sizeof *l1);
  12. (*l1)->key = k;
  13. return *l1;
  14. }
  15.  
  16. int main(void)
  17. {
  18. struct list *l;
  19. int i;
  20.  
  21. for (i = 0; i < 42; ++i)
  22. l = append(&l, i);
  23. }
  24.  
Success #stdin #stdout 0.01s 1848KB
stdin
Standard input is empty
stdout
Standard output is empty