470,849 Members | 1,109 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Convert int to *char.

What is the correct way to convert an int to a *char?

Apr 10 '06 #1
2 2078
calcop wrote:
What is the correct way to convert an int to a *char?


By *char you probably mean string. Here's a good way:

http://www.parashift.com/c++-faq-lit....html#faq-39.1
"How do I convert a value (a number, for example) to a std::string?"

Always check with the FAQ before posting. It might happen to mention that
char* should be avoided unless simpler systems won't work.

--
Phlip
http://www.greencheese.org/ZeekLand <-- NOT a blog!!!
Apr 10 '06 #2
In article <11*********************@v46g2000cwv.googlegroups. com>,
ca****@gmail.com wrote:
What is the correct way to convert an int to a *char?


Do you mean make a string representation of a int?
<http://www.parashift.com/c++-faq-lit...es.html#faq-39.
1>
--
Magic depends on tradition and belief. It does not welcome observation,
nor does it profit by experiment. On the other hand, science is based
on experience; it is open to correction by observation and experiment.
Apr 10 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Markus Hämmerli | last post: by
1 post views Thread by Sam Smith | last post: by
5 posts views Thread by Brad Moore | last post: by
7 posts views Thread by MilanB | last post: by
15 posts views Thread by Yifan | last post: by
19 posts views Thread by caramel | last post: by
3 posts views Thread by Eric BOUXIROT | last post: by
5 posts views Thread by Zytan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.