Re: [Dev-C++] convert 'int' to 'char'/'str'
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2004-11-12 16:26:14
|
Most common methods: int my_int = 10; double my_double = 1.15; // Original C code char buf[100]; sprintf(buf,"%u %g",my_int,my_double); // Old C++ code (deprecated) #include <strstream> ostrstream s; // deprecated s << my_int << " " << my_double; string str = s.str(); // New C++ code #include <sstream> std::ostringstream s; s << my_int << " " << my_double; std::string str = s.str(); /Per W On Fri, 12 Nov 2004, Guillermo Gutierrez wrote: > Is there an easy to convert a numeric value (int, double, etc...) into a char or string? > something that would work similar to Delphi's 'IntToStr()' function? > > Guillermo Gutierrez > Market Scan Information Systems > Software Q.A. Supervisor > (818) 575-2000 x2427 > ggu...@ma... > > |