fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void foo(int & val){
  5. return;
  6. }
  7.  
  8. int main() {
  9. foo(4);
  10. return 0;
  11. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:9:7: error: invalid initialization of non-const reference of type 'int&' from an rvalue of type 'int'
  foo(4);
       ^
prog.cpp:4:6: note:   initializing argument 1 of 'void foo(int&)'
 void foo(int & val){
      ^
stdout
Standard output is empty