fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void func(int i, int& j, int p){
  5. i++;
  6. j++;
  7. p++;
  8. }
  9.  
  10. int main(){
  11. int i = 10;
  12. int j = 6;
  13. int &p = i;
  14. func(i, j, p);
  15. cout << i << " " << j << " " << p;
  16. }
Success #stdin #stdout 0.01s 5516KB
stdin
Standard input is empty
stdout
10 7 10