Re: [Dev-C++] convert 'int' to 'char'/'str'
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <ms...@wp...> - 2004-11-12 18:02:00
|
Dnia 2004-11-12 17:26, Użytkownik Per Westermark napisał:
(...)
> #include <sstream>
> std::ostringstream s;
> s << my_int << " " << my_double;
> std::string str = s.str();
This is (for me) the most in C++ style. For better similar to IntToStr()
from Delphi it can (?) be written as:
#include <sstream>
std::string itos(int i)
{
std::stringstream s;
s << i;
return s.str();
}
(Example found via google).
Regards
Marcin
|