Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,151,809 members, 7,813,666 topics. Date: Tuesday, 30 April 2024 at 03:55 PM

I Need Your Help - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / I Need Your Help (1269 Views)

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)

(1) (Reply)

I Need Your Help by esflagos: 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> &wink'
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> &wink'
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> &wink'
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 ==========

1 Like

(1) (Reply)

A Single Researcher Made $225,000 (legally!) By Hacking Browsers This Weekend / Please. I'm New To Programming. How Do I Start Learning It And Where? / Skilled PHP Programmer/freelancer Needed (smslive247.com) Urgent!!!!

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 14
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.