|
-
February 13th, 2012, 04:05 PM
#7
Re: STL friendly operator << doesn't work
OK, this is peculiar, but
Code:
ostream& operator << (ostream& strm, const char* s)
{
static string tmpstr;
tmpstr = s;
strm << tmpstr;
return strm;
}
solves the problem, so iostream doesn't, indeed, have this version of operator overloaded and that (printing const char *) worked because this was converted to std::string (this is only my guess).
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|