fork(42) download
  1. #include <iostream>
  2. using namespace std;
  3. int main(int a)
  4. {
  5. cout << a << "\n";
  6. return 0;
  7. }
  8. int main(char *a)
  9. {
  10. cout << a << endl;
  11. return 0;
  12. }
  13. int main(int a, int b)
  14. {
  15. cout << a << " " << b;
  16. return 0;
  17. }
  18. int main()
  19. {
  20. main(3);
  21. main("C++");
  22. main(9,6);
  23. return 0;
  24. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:3:5: warning: ‘int main(int)’ takes only zero or two arguments [-Wmain]
 int main(int a)
     ^
prog.cpp:8:5: warning: first argument of ‘int main(char*)’ should be ‘int’ [-Wmain]
 int main(char *a)
     ^
prog.cpp:8:5: warning: ‘int main(char*)’ takes only zero or two arguments [-Wmain]
prog.cpp: In function ‘int main(char*)’:
prog.cpp:8:17: error: declaration of C function ‘int main(char*)’ conflicts with
 int main(char *a)
                 ^
prog.cpp:3:5: error: previous declaration ‘int main(int)’ here
 int main(int a)
     ^
prog.cpp: At global scope:
prog.cpp:13:5: warning: second argument of ‘int main(int, int)’ should be ‘char **’ [-Wmain]
 int main(int a, int b)
     ^
prog.cpp: In function ‘int main(int, int)’:
prog.cpp:13:22: error: declaration of C function ‘int main(int, int)’ conflicts with
 int main(int a, int b)
                      ^
prog.cpp:8:5: error: previous declaration ‘int main(char*)’ here
 int main(char *a)
     ^
prog.cpp:13:22: error: declaration of C function ‘int main(int, int)’ conflicts with
 int main(int a, int b)
                      ^
prog.cpp:3:5: error: previous declaration ‘int main(int)’ here
 int main(int a)
     ^
prog.cpp: In function ‘int main()’:
prog.cpp:18:10: error: declaration of C function ‘int main()’ conflicts with
 int main()
          ^
prog.cpp:13:5: error: previous declaration ‘int main(int, int)’ here
 int main(int a, int b)
     ^
prog.cpp:18:10: error: declaration of C function ‘int main()’ conflicts with
 int main()
          ^
prog.cpp:8:5: error: previous declaration ‘int main(char*)’ here
 int main(char *a)
     ^
prog.cpp:18:10: error: declaration of C function ‘int main()’ conflicts with
 int main()
          ^
prog.cpp:3:5: error: previous declaration ‘int main(int)’ here
 int main(int a)
     ^
prog.cpp:21:15: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
     main("C++");
               ^
stdout
Standard output is empty