#include <iostream> using namespace std; void f(int &p) { int &p2 = p + 1; cout << "Value is: " << p2; } int main() { // your code goes here int i = 10; f(i); return 0; }
Standard input is empty
prog.cpp: In function 'void f(int&)': prog.cpp:6:15: error: invalid initialization of non-const reference of type 'int&' from an rvalue of type 'int' int &p2 = p + 1; ^
Standard output is empty