fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. struct node{
  6. struct node *left;
  7. struct node *right;
  8. };
  9.  
  10.  
  11.  
  12. preorder(node)
  13. {
  14. if(node == NULL){
  15. return;
  16. }
  17. preorder(p->left);
  18. preorder(p->right);
  19. }
  20.  
Compilation error #stdin compilation error #stdout 0s 9432KB
stdin
Standard input is empty
compilation info
prog.c:12:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
 preorder(node)
 ^~~~~~~~
prog.c: In function ‘preorder’:
prog.c:12:1: warning: type of ‘node’ defaults to ‘int’ [-Wimplicit-int]
prog.c:14:10: warning: comparison between pointer and integer
  if(node == NULL){
          ^~
prog.c:15:3: warning: ‘return’ with no value, in function returning non-void
   return;
   ^~~~~~
prog.c:12:1: note: declared here
 preorder(node)
 ^~~~~~~~
prog.c:17:11: error: ‘p’ undeclared (first use in this function)
  preorder(p->left);
           ^
prog.c:17:11: note: each undeclared identifier is reported only once for each function it appears in
stdout
Standard output is empty