#include<iostream>
using namespace std;
#include<string>
class person
{
public:
//传统方式初始化
/*person(int a, int b)
{
m_a = a;
m_b = b;
}*/
//初始化列表方式初始化
person(int a,int b):m_a(a),m_b(b){}
void printffun()
{
cout << "m_a:" << m_a << endl;
cout << "m_b:" << m_b << endl;
}
~person()
{
cout << "默认析构函数调用" << endl;
}
private:
int m_a, m_b;
};
int main()
{
person p(10, 20);
p.printffun();
system("pause");
return 0;
}