#include<iostream>
class A
{
public:
int a = 1;
int b = 2;
int c = 3;
int d = 4;
void f1()
{
std::cout << this << std::endl;
std::cout << &this->a << std::endl;
std::cout << &this->b << std::endl;
std::cout << &this->c << std::endl;
std::cout << &this->d << std::endl;
}
};
using namespace std;
int main()
{
A D;
D.f1();
}
运行结果:
000000768AAFF678
000000768AAFF678
000000768AAFF67C
000000768AAFF680
000000768AAFF684
//请问为什么输出的第一行和第二行相同