Hi,
I'm trying to write a wide string into a std::ostringstream as follows
for(int i = 0; i < temp.length(); ++i)
{
oss << oss.narrow(temp, '%');
}
and I get the following error:
c:\...\file.cpp : warning C4244: 'argument' : conversion from 'std::allocator<_Ty>::value_type' to 'char', possible loss of data
with
[
_Ty=wchar_t
]
Is there a better (standard) way of doing this? Particularly, I'd prefer to convert the wstring into a string, and then just append that to the ostringstream, because then I can reuse the narrowing conversion wherever I want from a conversion class.
I tried boost::lexical_cast, but that didn't work, so I'm a bit stumped.
Thanks
We scratch our eternal itchA twentieth century bitchWe are grateful forOur Iron Lung