-
August 22nd, 2009, 03:52 AM
#1
Statement cannot resolve adress of overloaded function
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
#include <string>
using std::string;
using std::getline;
class GradeBook
{
public:
void displayMessage()
{
cout << "Welcome to the grade book for course: " << getCourseName()
<< endl;
}
void setCourseName( string name )
{
courseName = name;
}
string getCourseName()
{
return courseName;
}
private:
string courseName;
};
int main()
{
GradeBook myBook;
string myCourseName;
cout << "The initial course name is: " << myBook.getCourseName() << endl;
cout << "Enter new course name: ";
getline( cin, myCourseName );
myBook.setCourseName( myCourseName );
myBook.displayMessage; /* THIS IS WHERE I GET MY ERROR */
return 0;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|