469,643 Members | 1,238 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,643 developers. It's quick & easy.

method to convert integer to string

Hi,
I would like to know the method to convert integer to string.
Thanx in advance.
Feb 14 '08 #1
4 1994
mthread wrote:
Hi,
I would like to know the method to convert integer to string.
Use a stringstream.

--
Ian Collins.
Feb 14 '08 #2
On 14 Ún, 08:22, mthread <rjk...@gmail.comwrote:
Hi,
I would like to know the method to convert integer to string.
Thanx in advance.
#include <string>
#include <sstream>

// Fn should return true if conversion succeeded
template<typename INT>
bool ToInt(const std::string& s, INT& i)
{
std::istringstream iss(s);
s >i;
return !iss.bad();
}
Feb 14 '08 #3
mthread wrote:
Hi,
I would like to know the method to convert integer to string.
Thanx in advance.
I heard about this great new tool on the web that lets you search for stuff.

It's called "Google". You really should try it.
Feb 14 '08 #4
mthread wrote:
Hi,
I would like to know the method to convert integer to string.
Thanx in advance.
This is how:

http://austria.svn.sourceforge.net/v...=1&view=markup

I think the c.l.c++ faq lite has some more info.
Feb 14 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

16 posts views Thread by Jeff Wagner | last post: by
5 posts views Thread by IamZadok | last post: by
4 posts views Thread by Lerp | last post: by
8 posts views Thread by Carlos | last post: by
5 posts views Thread by Mika M | last post: by
14 posts views Thread by Drew | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.