fork download
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int & func(){
  5.  
  6. int x = 10;
  7. return x;
  8.  
  9. }
  10.  
  11. int main() {
  12.  
  13. int &y = func();
  14. cout << y << endl;
  15.  
  16. return 0;
  17.  
  18. }
Success #stdin #stdout 0.01s 2724KB
stdin
Standard input is empty
stdout
10