c++ – Error at constructor : Expected an identifier?

c++ – Error at constructor : Expected an identifier?

Your constructor should be defined the following way

Student::Student() { /* some code */ } 

Since a Student has a const int id member, you need to initialize it in the constructors
initialization list. E.g.:

Student::Student() : id(0)
{ }

c++ – Error at constructor : Expected an identifier?

Leave a Reply

Your email address will not be published. Required fields are marked *