I Need Your Help - Programming - Nairaland
Nairaland Forum › Science/Technology › Programming › I Need Your Help (1449 Views)
1 Reply
| I Need Your Help by esflagos(op): 6:10am On Oct 17, 2009 |
pls am new to c++ programming and am ahving problems in trying to debug this class . pls if there is any boby that could enlighten me more on how to open an header file and Defining a Class with a Member Function. thankz. after i deggued this function displayMessage, // create a GradeBook object, and call its displayMessage function. #include <iostream> using std::cout; using std::endl; // GradeBook class definition class GradeBook { public: // function that displays a welcome message to the GradeBook user void displayMessage() { cout << ”Welcome to the Grade Book!” << endl; } // end function displayMessage }; // end class GradeBook // function main begins program execution int main() { GradeBook myGradeBook; // create a GradeBook object named myGradeBook myGradeBook.displayMessage(); // call object's displayMessage function return 0; // indicate successful termination } // end main it wrote 1>------ Build started: Project: gradebooked, Configuration: Debug Win32 ------ 1>Compiling, 1>gradebooked.cpp 1>c:\users\pensure\documents\visual studio 2005\projects\game\game\gradebooked\gradebooked\gradebooked.cpp(1) : error C2146: syntax error : missing ';' before identifier 'displayMessage' 1>c:\users\pensure\documents\visual studio 2005\projects\game\game\gradebooked\gradebooked\gradebooked.cpp(1) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>c:\users\pensure\documents\visual studio 2005\projects\game\game\gradebooked\gradebooked\gradebooked.cpp(1) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>c:\program files\microsoft visual studio 8\vc\include\sal.h(226) : error C2059: syntax error : 'extern ' 1>c:\program files\microsoft visual studio 8\vc\include\sal.h(226) : error C2143: syntax error : missing ';' before '{' 1>c:\program files\microsoft visual studio 8\vc\include\sal.h(226) : error C2447: '{' : missing function header (old-style formal list?) 1>c:\users\pensure\documents\visual studio 2005\projects\game\game\gradebooked\gradebooked\gradebooked.cpp(13) : error C2065: '”Welcome' : undeclared identifier 1>c:\users\pensure\documents\visual studio 2005\projects\game\game\gradebooked\gradebooked\gradebooked.cpp(13) : error C2146: syntax error : missing ';' before identifier 'to' 1>c:\users\pensure\documents\visual studio 2005\projects\game\game\gradebooked\gradebooked\gradebooked.cpp(13) : error C2065: 'to' : undeclared identifier 1>c:\users\pensure\documents\visual studio 2005\projects\game\game\gradebooked\gradebooked\gradebooked.cpp(13) : error C2146: syntax error : missing ';' before identifier 'the' 1>c:\users\pensure\documents\visual studio 2005\projects\game\game\gradebooked\gradebooked\gradebooked.cpp(13) : error C2065: 'the' : undeclared identifier 1>c:\users\pensure\documents\visual studio 2005\projects\game\game\gradebooked\gradebooked\gradebooked.cpp(13) : error C2146: syntax error : missing ';' before identifier 'Grade' 1>c:\users\pensure\documents\visual studio 2005\projects\game\game\gradebooked\gradebooked\gradebooked.cpp(13) : error C2065: 'Grade' : undeclared identifier 1>c:\users\pensure\documents\visual studio 2005\projects\game\game\gradebooked\gradebooked\gradebooked.cpp(13) : error C2146: syntax error : missing ';' before identifier 'Book' 1>c:\users\pensure\documents\visual studio 2005\projects\game\game\gradebooked\gradebooked\gradebooked.cpp(13) : error C2065: 'Book' : undeclared identifier 1>c:\users\pensure\documents\visual studio 2005\projects\game\game\gradebooked\gradebooked\gradebooked.cpp(13) : error C2143: syntax error : missing ';' before '!' 1>c:\users\pensure\documents\visual studio 2005\projects\game\game\gradebooked\gradebooked\gradebooked.cpp(13) : error C2065: '”' : undeclared identifier 1>c:\users\pensure\documents\visual studio 2005\projects\game\game\gradebooked\gradebooked\gradebooked.cpp(13) : error C2563: mismatch in formal parameter list 1>c:\users\pensure\documents\visual studio 2005\projects\game\game\gradebooked\gradebooked\gradebooked.cpp(13) : error C2568: '<<' : unable to resolve function overload 1> c:\program files\microsoft visual studio 8\vc\include\ostream(937): could be 'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> & '1> c:\program files\microsoft visual studio 8\vc\include\ostream(963): or 'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> & '1> with 1> [ 1> _Elem=char, 1> _Traits=std::char_traits<char> 1> ] 1> c:\program files\microsoft visual studio 8\vc\include\ostream(971): or 'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> & '1> with 1> [ 1> _Elem=wchar_t, 1> _Traits=std::char_traits<wchar_t> 1> ] 1>Build log was saved at "file://c:\Users\pensure\Documents\Visual Studio 2005\Projects\game\game\gradebooked\gradebooked\Debug\BuildLog.htm" 1>gradebooked - 19 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== |
I Need Your Help To Evaluate My Apps. • Java Programmers; I Need Your Help Urgently Pleaseeeee • Please I Really Need Your Help Urgently . • 2 • 3 • 4
Something I'm Working On. Need Contributions • Help, In Choosing A Tangible And Successful Career. • Help A Newbie Php Programmer
'