fork download
  1. #include<stdio.h>
  2. #include<math.h>
  3.  
  4. char g[3][3];
  5.  
  6. void reset() {
  7. for(int i = 0; i < 3; i++)
  8. for (int j = 0; j < 3; j++)
  9. g[i][j] = ' ';
  10. }
  11.  
  12. int display(void)
  13. {
  14. printf("%c|%c|%c",g[0][0],g[0][1],g[0][2]);
  15. printf("------------");
  16. printf("%c|%c|%c",g[1][0],g[1][1],g[1][2]);
  17. printf("------------");
  18. printf("%c|%c|%c",g[2][0],g[2][1],g[2][2]);
  19. }
  20.  
  21. int start()
  22. {
  23. int i,j
  24. printf("Enter coordinates for move");
  25. scanf("%d %d",&i &j);
  26. g[i+1][j+1]= 1;
  27. display();
  28.  
  29. int main()
  30. {
  31. reset();
  32. display();
  33. printf("X starts the game");
  34. start();
  35. return 0;
  36. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘start’:
prog.c:24:2: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘printf’
  printf("Enter coordinates for move");
  ^~~~~~
prog.c:25:20: error: ‘j’ undeclared (first use in this function)
  scanf("%d %d",&i &j);
                    ^
prog.c:25:20: note: each undeclared identifier is reported only once for each function it appears in
prog.c:29:6: warning: ‘main’ is normally a non-static function [-Wmain]
  int main()
      ^~~~
prog.c:36:2: error: expected declaration or statement at end of input
  }
  ^
prog.c: In function ‘display’:
prog.c:19:2: warning: control reaches end of non-void function [-Wreturn-type]
  }
  ^
prog.c: In function ‘start’:
prog.c:36:2: warning: control reaches end of non-void function [-Wreturn-type]
  }
  ^
At top level:
prog.c:29:6: warning: ‘main’ defined but not used [-Wunused-function]
  int main()
      ^~~~
stdout
Standard output is empty