A constructor constructs (i.e. initialises) the object, and the point of a ctor is to do that automatically rather than you having to do that manually.
So the line
will automatically call a.Student() for you. Here's how to write a constructor that initialises Student's attributes to zero:
Code:
class Student
{
private:
int idnum;
double grades[5];
int totnumgrades;
public:
Student()
{
idnum=0;
totnumgrades=0;
for (int i=0; i<5; grades[i++]=0) ;
}
//...
};