fork download
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3.  
  4. typedef struct node
  5. {
  6. int val;
  7. struct node *link;
  8. }hop;
  9.  
  10. hop *change_val(struct node*);
  11.  
  12. main()
  13. {
  14. hop *m,*t;
  15. m=(hop *)malloc(sizeof (hop));
  16. m->val=10;
  17. t=change_val(m);
  18. printf("%d",t->val);
  19. }
  20.  
  21. hop *change_val(struct node* m)
  22. {
  23. m->val=20;
  24. return m;
  25. }
Runtime error #stdin #stdout 0.01s 1852KB
stdin
Standard input is empty
stdout
20