定义
// 栈方式定义对象数组 Teacher t[2]; t[0].setGender("男"); cout << t[0].getGender() << endl;
// 堆方式定义对象数组 Teacher *p = new Teacher[3]; p[0].setGender("女"); cout << p[0].getGender() << endl; delete[]p;
p=NULLL;