Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 136,585 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,969 people online right now. Registration is fast and FREE... Join Now!




Converting Integer to String

 
Reply to this topicStart new topic

Converting Integer to String

Techno Mage
26 Sep, 2008 - 01:25 PM
Post #1

D.I.C Head
**

Joined: 10 Jun, 2007
Posts: 58


My Contributions
I feel strange asking this because it feels like it should be easy, but how do I convert from integer to a string? I read a snippet on here to use stringstream but how do I do this in a loop? The stringstream keeps all of the numbers and I need to flush them out at the end so it's empty at the beginning of the loop.
User is offlineProfile CardPM
+Quote Post

JackOfAllTrades
RE: Converting Integer To String
26 Sep, 2008 - 01:45 PM
Post #2

Cantankerous Old Fart
Group Icon

Joined: 23 Aug, 2008
Posts: 580



Thanked: 59 times
Dream Kudos: 50
My Contributions
Use
cpp
 ss.str("");

to clear out the contents when you're done with them.
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/3/08 12:50AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month