私はC++を学んでおり、本でこれを見つけました:
#include <iostream>
using namespace std;
int main()
{
int Age = 30;
int* pInteger = &Age; // pointer to an int, initialized to &Age
// Displaying the value of pointer
cout << “Integer Age is at: 0x” << hex << pInteger << endl;
return 0;
}
この本によると、出力は Age が格納されているメモリ内のアドレスです。
しかし、本はこれについて話していません:
*pInteger = &Age;
pInteger = &Age;
これら2つの割り当ての違いは何ですか?