cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Why is the below class definition NOT va
Why is the below class definition NOT valid
Jul 17, 2012 at 11:31pm UTC
billandmisty78
(10)
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 UTC
Volatile Pulse
(1543)
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 UTC
Peter87
(11234)
Volatile Pulse
wrote:
Also the constructors are supposed to have datatypes.
What do you mean by that?
Jul 17, 2012 at 11:47pm UTC
billandmisty78
(10)
DUH, I should have seen that. It's the smallest details that get me on these. Thanks Volatile!
Jul 18, 2012 at 12:07am UTC
Volatile Pulse
(1543)
Peter87
wrote:
What do you mean by that?
Oops, I meant aren't. Stupid smart phone -.-
Topic archived. No new replies allowed.