为什么(VS2022)编辑窗口会多出“析构函数”这一行?救命
#include<iostream>
using namespace std;
#include<string>
class Phone
{
public:
Phone(string pname)
{
m_pname = pname;
}
string m_pname;
};
class Person
{
public:
Person(string name, string pname) :m_name(name), m_phone(pname)
{
}
string m_name;
Phone m_phone;
};
void funn()
{
Person p("张三", "小米");
cout << p.m_name << "拿着: " << p.m_phone.m_pname<<endl;
}
int main()
{
funn();
system("pause");
return 0;
}