fork download
  1. void DoSomething(const int &a)
  2. {
  3. // ...
  4. }
  5.  
  6. void DoSomething2(int &a)
  7. {
  8. // ...
  9. }
  10.  
  11. int main()
  12. {
  13. DoSomething(222);
  14. DoSomething2(222);
  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: error: invalid initialization of non-const reference of type ‘int&’ from a temporary of type ‘int’
prog.cpp:6: error: in passing argument 1 of ‘void DoSomething2(int&)’
stdout
Standard output is empty