fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void f(long &p)
  5. {
  6. cout << "Value is: " << p;
  7. }
  8.  
  9.  
  10. int main() {
  11. // your code goes here
  12. int i = 10;
  13.  
  14. f((long)i);
  15. return 0;
  16. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:14:11: error: invalid initialization of non-const reference of type 'long int&' from an rvalue of type 'long int'
  f((long)i);
           ^
prog.cpp:4:6: note: in passing argument 1 of 'void f(long int&)'
 void f(long &p)
      ^
stdout
Standard output is empty