我在该文件上有一个班级学生 - student.h 这是它的构造函数:
class Student
{
protected:
double _id;
double _salary;
double _grade_average;
public:
Student(double id, double salary,double average):
_id(id),_salary(salary),_grade_average(average)
{}
};
然后我收到错误:
对'vtable for Student'的未定义引用
有什么问题?
这是一个University.h文件:
#include "Student.h"
class University : public Student
{
public:
virtual double getValue();
University(char university_id,double id, double average,double salary):
_university_id(university_id),Student(id,average,salary)
{
}
private:
char _university_id;
static double how_many;
static double sum_avg_grades;
};
答案 0 :(得分:2)
有几件事。