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