#include <iostream>
using namespace std;
class Student {
public:
char* name;
int age;
float score;
void say() {
cout << name << "的年龄是" << age << ",成绩是" << score << endl;
}
};
class UIH {
public:
char* name;
char* ID;
};
int main() {
Student* pStu = new Student;
pStu->name = "小明";
pStu->age = 15;
pStu->score = 92.5f;
pStu->say();
delete pStu; //删除对象
UIH lzb;
lzb.name = "小李";
lzb.ID = "144";
cout << lzb.ID << ", " << lzb.name << endl;
return 0;
}
/* 输出:
小明的年龄是15,成绩是92.5
144, 小李
请按任意键继续. . .
*/