Originally posted by velius
You return a reference to the stream object to be used in calling the stream again in a row. Just like with cout.
Is this correct then?
Code:
dStream dStream::operator <<(char *param)
{
DWORD size;
size=GetWindowTextLength(hEdit);
SendMessage(hEdit, EM_SETSEL,size,size);
SendMessage(hEdit, EM_REPLACESEL, (WPARAM) false, (LPARAM) param);
return *this;
}
endl just outputs the '\n' character, then flushes the output buffer.
When I do that I get an error.
Code:
ds << "byebye" << std::endl;
error C2679: binary '<<' : no operator defined which takes a right-hand operand of type '' (or there is no acceptable conversion)
I understand that I may need to overload again, but in what way?