"Tim Slattery" <Sl********@bls.govwrote in message
news:dc********************************@4ax.com...
I'm trying to convert a 64-bit inter to a character string, and
failing. I don't understand the error.
here's the code:
__int64 num = 123456789012;
std::ostringstream buffer;
buffer << num;
std::string formatted = buffer.str();
The error message points at the third line and says: operator << is
ambiguous. Huh??
Apparently your compiler doesn't define an operator<< for an ostringstream
for 16 bit unsigned ints.
However, your compiler usually tells you the choices it has after the error
message (along the lines of, operator<<( ostringbuffer, int ) or
operator<<( ostringbuffer, unsigned int ), etc...
Go through those choices and see if you have anything that's 64 bit. You
might be lucky and maybe they have 64 bit unsigned ints, in that case either
change it to unsigned 64 bit int or cast it in the << statment.