这个错误怎么改掉呀
#include<iostream>
using namespace std;
#include<string>
class Phone
{
public:
Phone(string pName)
{
cout << "phone的构造函数" << endl;
m_PName = pName;
}
~Phone()
{
cout << "phone的析构函数" << endl;
}
string m_PName;
};
class Person
{
public:
Person(string name, string pname): m_Name(name),m_Phone(pname)
{
cout << "person的构造函数" << endl;
}
~Person()
{
cout << "person的析构函数" << endl;
}
string m_Name;
Phone m_Phone;
};
void test01()
{
Person p("张三","苹果");
cout << p.m_Name<<"使用的手机是" << p.m_Phone << endl;
}
int main()
{
test01();
system("pause");
}

