fork download
  1. #include<stdio.h>
  2. #include<iostream>
  3. using namespace std;
  4. void fun(int a)
  5. {
  6. return a;
  7.  
  8. }
  9. void fun(char a)
  10. {
  11. return a;
  12. }
  13. void fun(double a)
  14. {
  15. return a;
  16. }
  17. int main()
  18. {
  19. int c=fun(10);
  20. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘void fun(int)’:
prog.cpp:6:12: error: return-statement with a value, in function returning 'void' [-fpermissive]
prog.cpp: In function ‘void fun(char)’:
prog.cpp:11:12: error: return-statement with a value, in function returning 'void' [-fpermissive]
prog.cpp: In function ‘void fun(double)’:
prog.cpp:15:12: error: return-statement with a value, in function returning 'void' [-fpermissive]
prog.cpp: In function ‘int main()’:
prog.cpp:19:17: error: void value not ignored as it ought to be
prog.cpp:19:9: warning: unused variable ‘c’ [-Wunused-variable]
stdout
Standard output is empty