![]() |
|
|
|
| ||||||
|
Welcome to the The ProgrammersTalk Community forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| Tags: help, progrmaming, tutorial |
![]() |
![]() | | LinkBack | Thread Tools | Display Modes | ![]() |
| |
| |||
| Firstly, there should be no semicolons in #include directives Code: #include <iostream>; #include <string>; Lastly, you're missing a semicolon at the end of your class declaration Code: class GradeBook {
public:
GradeBook(string); // constructor
void setCourseName(string);
string getCourseName();
void displayMessage();
void inputGrades();
void displayGradeReport();
int maximum(int, int, int);
private:
string courseName;
int maximumGrade;
} ; The reason it gave you an error message about your constructor, is that you had written Code: #include "GradeBook.h" Last edited by Bench : 07-22-2007 at 04:36 PM. |
| The Following User Says Thank You to Bench For This Useful Post: | ||
HelloWorld (07-22-2007) | ||
| ||||
| DARN IT! I always forgot to put semi colon right after the class!!! OMG!!! I'm used with Java, that's why lol.. there's no semi colon after class XD Thanx a lot Bench, it's fixed because of the semi colon. I need to get used with this.. For the string thing, I just want to try substr ![]() BTW, I didn't remove the semi colon right on my include statement, and it seems that it ignores it...? ![]() |
| ||||
| Maybe it is something to do with your compiler? It may see that includes closing arrow ">" and not compile anything on that line after that arrow. |
| |||
| Some compilers may ignore the semicolon after #include directives, however, its not in the standard, so some will throw up an error about it. (I've noticed that MSVC++ ignores semicolons here - I can only imagine the reason is for some MS language extension) Last edited by Bench : 07-22-2007 at 04:43 PM. |
| The Following User Says Thank You to Bench For This Useful Post: | ||
HelloWorld (07-22-2007) | ||
![]() |
| Thread Tools | |
| Display Modes | |
| |