Created
February 15, 2020 12:13
-
-
Save fereria/a53547de7d1f61b221fd80d00a4a8483 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
void pointerTest_01() | |
{ | |
int hoge = 10; | |
int& refHoge = hoge; // hogのの参照 | |
int* pHoge = &hoge; // 初期化 | |
refHoge = 20; | |
cout << pHoge << endl; // pHogeのアドレス | |
cout << *pHoge << endl; // pHogeの実体 | |
cout << hoge << endl; // pHoge | |
cout << &refHoge << endl; | |
cout << refHoge << endl; // 参照 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment