Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

C++ conversion of integers into strings, how

  1. Oct 25, 2006 #1
    how to convert an input of integer(more than 1 character) type into output which is in string in c++
  2. jcsd
  3. Oct 25, 2006 #2


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    (I'm assuming you've acquired an int value that you wish to convert into a char* or a std::string)

    Use std::stringstream. Or do it the C-way with sprintf. Or, roll your own method.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook