#include <iostream> using namespace std; class test { public: int a; test() : a(0){} test &operator*(){ cout << "operator*" << endl; cout << a << endl; return *this; } };
int main() { test *t; t = new test; test t2 = *t; t->a += 1; // t2.a += 1; *t = *t2; *t; // 这一行 *t2; // **t; // 注意*t 和 **t这两个的差别 return 0; }