class Student
{
public:
// 定義數據成員名字 m_strName 和年齡 m_iAge
string m_strName;
int m_iAge;
};
int main()
{
Student*p = new Student();
// 設置對象的數據成員
p->m_strName = "慕課網";
p->m_iAge = 2;
// 通過cout打印stu對象的數據成員
cout << p->m_strName << " " << p->m_iAge << endl;
system("pause");
return 0;
}