#include <iostream>
using namespace std;
class User
{
	  public:
	  int age;
	  int number;
	  User()
	  {
		     cout << "this is User contructor\r\n";
	  }
	  User& operator=(const User & uer)
	  {
		     cout << "this is User operator =\r\n";
		    return *this;
	  }
	  User(const User &user)
	  {
        cout << "调用拷贝构造函数并为指针 ptr 分配内存" << endl;
	  }
};int main()
{
	  User user;
	  User c;
	  c=user;
	  User b=user;
     cout << "Hello World";
     return 0;
}

C++ 中的User a, User b=a 和User a, User b, b=a的区别_拷贝构造函数