Why is the below class definition NOT valid

Jul 17, 2012 at 11:31pm
Please take a look and let me know why the below class definition is not valid.


class student
{
public:
void student();
void student(string s, double g, int i);
void set(string s, double g, int i);
void print();
private:
string name;
double gpa;
int id;
}
Jul 17, 2012 at 11:36pm
You're missing the semicolon after the declaration of your class. I assume that you have your definitions either in another file or further below and didn't include them.

Also the constructors are supposed to have datatypes.
Jul 17, 2012 at 11:40pm
Volatile Pulse wrote:
Also the constructors are supposed to have datatypes.

What do you mean by that?
Jul 17, 2012 at 11:47pm
DUH, I should have seen that. It's the smallest details that get me on these. Thanks Volatile!
Jul 18, 2012 at 12:07am
Peter87 wrote:
What do you mean by that?

Oops, I meant aren't. Stupid smart phone -.-
Topic archived. No new replies allowed.