Conversion from int to basic string
-
I think he was asking how to convert an integer into a std::string directly
-
I think he was asking how to convert an integer into a std::string directly
-
If he do so we can pause him... ;) He is providing C:\> prompt... Just type "pause" command there... :) - NS -
-
hey, don't worry, i'm a pacific intergalactic traveler... my only purpose is to provide C/C++ knowledge around our universe ;)
-
Hi Friend, Is there any API which convert int(int a) to basic string(string b)? itoa can convert a(int) to char*(Char *c) and I can get b from c.However is there any other way? Thanks :)
Here's how I'd go about doing it:
ostringstream ss; ss << "PI = " << 3.14159265; string s = ss.str();
Includes you'll need: <string> <sstream> Assumes:using namespace std;
Steve -
hum, so i didn't understand your question... in MS-DOS,
C:\>
is the common prompt to tell that you are located on the root directory of the C: drive. thever
command displays the actual version on MS-DOS installed (or windows since WinNT4 - as it doesn't need dos anymore) if i still don't answer your question, please rephrase:^)