using namespace std;
class Student
{
public:
string m_strName;
int m_iAge;
};
int main()
{
Student *p = new stu;
stu.m_strName = "慕课网";
stu.m_iAge = 2;
cout << p -> m_strName << " " << p -> m_iAge<< endl;
delete p;
p = NULL;
return 0;
}
class Student
{
public:
string m_strName;
int m_iAge;
};
int main()
{
Student *p = new stu;
stu.m_strName = "慕课网";
stu.m_iAge = 2;
cout << p -> m_strName << " " << p -> m_iAge<< endl;
delete p;
p = NULL;
return 0;
}