fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. typedef struct fib {
  5. long long num;
  6. struct fib *next;
  7. } fib;
  8.  
  9. int main(void) {
  10. fib *head, *pointer;
  11. head = malloc(sizeof(fib));
  12. pointer = malloc(sizeof(fib));
  13. head->num = 123;
  14. head->next = pointer;
  15. head->next->num = 456;
  16. pointer->next = NULL;
  17.  
  18. printf("%lld %lld\n", head->num, head->next->num);
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0s 4244KB
stdin
Standard input is empty
stdout
123 456