Problem with cout <<
This code seems like it should work, but my compiler is giving me this message:
error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion)
and here's my code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
/* Testing OctoJesus */
#include <iostream>
using namespace std;
class OJesus
{
public:
string ShowStatus();
};
string OJesus::ShowStatus()
{
return( "OctoJesus is doing just fine." );
}
int main()
{
OJesus oj;
cout << oj.ShowStatus();
cin.get();
return 0;
}
|
Last edited on
Try to #include<string>
Topic archived. No new replies allowed.