But i'm encountering some weird issues.
The cout statement is couting the initial value of s, as the s is the first thing encountered after cout <<.
Then its couting "Hallo Welt!".
I had wanted the Hallo Welt to be stored in s before the couting.
But if I try to force the order of operations the way I want with a ()
e.g. cout << (s << "Hello Welt");
it couts 1, the boolean equivalent of s << "Hello Welt" having been achieved.
How can I achieve this?
So far the best that I can come up with is:
1 2 3 4 5 6 7
str operator = (const string & rhs)
{
data = rhs;
//return data;
return *this;
}//declared in class str of course
cout << (s = "To be or not to be, that is the question.\n") << flush << endl;