fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. struct Node
  6. {
  7. int cargo;
  8. };
  9.  
  10. struct Node* create_node()
  11. {
  12. struct Node node = malloc(sizeof(struct Node));
  13. return &node;
  14. }
  15.  
  16. int main()
  17. {
  18.  
  19. return 0;
  20. }
  21.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘create_node’:
prog.c:12:45: error: invalid initializer
prog.c:13:5: error: function returns address of local variable [-Werror]
cc1: all warnings being treated as errors
stdout
Standard output is empty