fork download
  1. #include <iostream>
  2. using namespace std;
  3. int & fun()
  4. {
  5. static int a = 20;
  6. return a;
  7. }
  8. int main()
  9. {
  10. int& y = fun();
  11. y = y + (-10);
  12. cout<<fun()<<endl;
  13. return 0;
  14. }
Success #stdin #stdout 0.01s 5520KB
stdin
Standard input is empty
stdout
10