I try to implement basic class of student in the following way:
class Student
{
public:
Student(std::string name_ , int const id_);
virtual ~Student();
void addGrade(int const grade2add);
void print();
private:
std::string name;
int const id;
std::vector<int> grades;
int cost maxGrade;
};
The constructor:
Student::Student(std::string name_, int const id_): name(name_), id(id_)
{
if (name.size()>=20)
{
cout<<"Name should be less than 20 chars"<<endl;
}
if (id.size()!=5)
{
cout<<"Id should be 5 nums"<<endl;
}
}
The main: using namespace std;
int main()
{
cout << "Hello School!" << endl;
Student sarit_student("Sarit Rotshild",12345);
return 0;
}
*all the relevant libraries and file are included. I got the following error: error: uninitialized member 'Student::maxGrade' with 'const' type 'const int' [-fpermissive]