我有像
这样的任务创建一个Student类,其属性包括:name,address, 电话。年龄,性别,学习年份......,以及阅读和阅读的方法 将这些属性写为私有数据。
创建一类学生 列表(一个方向)与指向第一个元素的指针 学生对象列表。
第一步,我在student.cpp中编写了这样的代码。
#include "student.h"
class Student
{
private:
QString name;
QString adress;
int telephone;
int age;
int year_of_study;
public:
Student();
Student(QString name, QString adress,int telephone,int age,int year_of_study);
QString getName();
QString getAdress();
int getTelephone();
int getAge();
int getYos();
};
对于第二步,我不知道如何指向Student对象列表的第一个元素。我会在学生班级和学生列表课程中生成一个列表吗?我会指出第一个元素吗?