www.gusucode.com > 《C++高级语言程序设计》PPT及全书例子源代码-源码程序 > 《C++高级语言程序设计》PPT及全书例子源代码-源码程序/code/C++例题程序/第4章/s4_1/smain4_1.cpp
//Download by http://www.NewXing.com //主文件 //文件名:ch4_1\smain4_1.h #include "sclass4_1_student.h" //包含类定义头文件 //主测试程序 void main() { CPerson oCPerson("德华刘","男"); //构造一个CPerson类的对象 CStudent oCStudent(20050101,"学友张","男"); //构造一个CStudent类德对象 oCPerson.Show(); //显示oCPerson对象的姓名和性别 oCStudent.Show(); //显示oCStudent对象的姓名、性别和学号 cin.get(); }