Do you have any other constructors? (overloaded)
If not, post more code.
Nick Evan
Not a Llama
10,112 posts since Oct 2006
Reputation Points: 4,142
Solved Threads: 403
Implementation looks pretty fine. Post the declaration too.
BTW, the declaration should be
class student{
public:
student();
~student();
//other stuff
}
siddhant3s
Practically a Posting Shark
816 posts since Oct 2007
Reputation Points: 1,486
Solved Threads: 140
[psychic debugging]
You probably forgot to terminate your class definition with a semicolon and the constructor definition immediately follows it. The following code should produce a similar error:
class foo {
public:
foo();
}
foo::foo() {}
The error is saying that the constructor for foo is trying to use the type foo (specified by a class definition) as the return type for the constructor. However, a constructor doesn't have a return type, so the compiler issues a diagnostic.
[/psychic debugging]
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401