cout - C++ error: no match for 'operator<<' -


Hello I have a problem with this error, I do not understand what the problem is. So here's the full code :

#include & lt; Iostream & gt; #include & lt; String & gt; using namespace std; Class gradebook {public: gradebook (string name) {setCourseName (name); } // Gradebook Constructor Zero Set's Course Name (string name) {courseName = name; } // end setCourseName string getCourseName () {return courseName; // Return object's cursory} // And Caver Caracennam empty displayed message () {cout & lt; & Lt; "\ N" & lt; & Lt; GetCourseName () & lt; & Lt; "!" & Lt; & Lt; Endl; } // and displaysmessages Private: String Cronnam; }; // And Class Gradebook Ent Main () {// Two Gradebook Object Gradebook Gradebook 1 ("CS101 Introduction C ++ Programming"); Gradebook Gradebook 2 ("CS102 Data Structures In C ++"); Cout & lt; & Lt; "Gradebook 1 is designed for course:" & lt; & Lt; GradeBook1.displayMessage (); }

The error occurs when I am trying to print this line:

  cout & lt; & Lt; "Gradebook 1 is designed for course:" & lt; & Lt; GradeBook1.displayMessage ();  

If I call it gradeBook1.displayMessage (); I use this as a print code, but if I use it like I had shown it gives me a dirty error ..

Thank you!

display message () is the function which is zero Lets you not stream it because it is nothing but just call it in different lines.

Change

  cout & lt; & Lt; "Gradebook 1 is designed for course:" & lt; & Lt; GradeBook1.displayMessage ();  

to

  Cust & lt; & Lt; "Gradebook 1 designed for the course:"; GradeBook1.displayMessage ();  

Comments