Code:
void write_on_paper(string words)
{
if (InkLevelPercent <=0)
{
cout << "Oops! Out of ink!" << endl;
}
else
{
cout << words << endl;
InkLevelPercent = InkLevelPercent - words.length();
}
}
1>c:\users\noah\documents\visual studio 2008\projects\objsnclasses\objsnclasses\pen.h(40) : error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion)
The error code is referring to I'm still learning C++ and this is an example from the book. But it won't compile. can anybody help please? thanks in advance.