LoginSignup
0
0

More than 3 years have passed since last update.

C++ 参照渡し サンプルコード

Posted at

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
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0