&x 输出到控制台的代码是什么?

What is the code that &x outputs to console?

本文关键字:代码 是什么 控制台 输出      更新时间:2023-10-16

如果我这样做

int a;
int b;
int c;
int d;
int e;
int f;
int g;
int h;
cout << &a << endl;
cout << &b << endl;
cout << &c << endl;
cout << &d << endl;
cout << &e << endl;
cout << &f << endl;
cout << &g << endl;
cout << &h << endl;

在控制台中,我看到:0020F96C0020F9600020F9540020F9480020F93C0020F9300020F9240020F918

它表示内存中存储x的位置。

它是一个'x'的地址。您正在打印x的地址。

您选择打印x的地址,这就是当您有时打印的地址

cout << &x ;