cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
conversion
conversion
Nov 13, 2008 at 12:18am UTC
bhavana008
(1)
how to convert an integer to a string????????
Nov 13, 2008 at 12:26am UTC
jsmith
(5804)
sprintf, stringstream, boost::lexical_cast, etc...
Nov 13, 2008 at 1:28am UTC
vipul mehta
(12)
you can try out this:
#include <iostream>
#include <sstream>
using namespace std;
int main()
{
int number;
cin >> number;
stringstream ss;
ss << number;
string s = ss.str();
cout << s << endl;
return 0;
}
Last edited on
Nov 13, 2008 at 1:48am UTC
Nov 13, 2008 at 5:40am UTC
Zhuge
(4664)
@vipul mehta: Thank you for helping, but I think it is best not to give out code for free. Most people (most) will just copy and paste your code without learning anything, especially those whose questions have 3+ question marks at the end...
Topic archived. No new replies allowed.