C++ 参照渡し サンプルコード
C++をウェブ上で実行できるサイト:paiza C++
https://paiza.io/projects/0qe-WRfPMHzDToM0P0bLUg?language=cpp
#include <iostream>
using namespace std;
void aa(int& a){
cout << a << endl;
a++;
cout << a << endl;
}
int main(void){
// Your code here!
int a = 10;
aa(a);
cout << a << endl;
}
出力結果
10
11
11