Hi friends,
I'm learning to program in C++.
I'm using Notepad++ to author my code and Cygwin g++ to compile it.
main.cpp : in function 'int main() :
main.cpp : 38 : error: no match for 'operator << 'then a lot of jibberish and number of errors : 1
'
here take a look at the code
// Classes Practical
// Author : -
#include <iostream>
#include <string>
using namespace std;
class GradeBook{
public:
//Constructor
GradeBook( string parameter ){
setObject( parameter );
}
//Member Functions
string getObject(){
return courseName;
}
void setObject( string parameter ){
courseName = parameter;
}
void displayObject(){
cout << "Data member now contains : " << courseName << endl;
}
private:
//Data Members
string courseName;
};
int main(){
GradeBook myObject( "You got Owned, g++ won't compile" );
cout << "myObject initialized\n" << myObject.displayObject() << endl;
return 0;
}
Thank you for your time and help.