fork download
  1. #include<iostream>
  2. using namespace std;
  3. int &fun(int);
  4. int aa[10];
  5. int main()
  6. {
  7. int a=10;
  8. for(int i(0);i<10;i++)
  9. fun(i)=a+i;
  10. for(int i(0);i<10;i++)
  11. cout<<aa[i]<<" ";
  12. cout<<endl;
  13. }
  14. int &fun(int a)
  15. {
  16. return aa[a];
  17. }
Success #stdin #stdout 0.01s 5408KB
stdin
Standard input is empty
stdout
10 11 12 13 14 15 16 17 18 19