void DoSomething(const int &a) { // ... } void DoSomething2(int &a) { // ... } int main() { DoSomething(222); DoSomething2(222); return 0; }
Standard input is empty
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&)’
Standard output is empty