At 16:13 2007-03-27, John Gunnarsson wrote:
>Hi,
>
>How do I convert a integer to a string in c++ the best way?
>So far I have been using the following snippet, which seems a bit overklll.
>
>string intToStr(const int value)
>{
>         ostringstream result;
>
>         result << value;
>
>         return result.str();
>}
>
>
>Could someone enlighten me :)

looks correct to me (I won't ask why you think you need this).
boost::lexical_cast might be more to your taste...    www.boost.org


>//John
>
>
>To unsubscribe, send a blank message to 
><mailto:[EMAIL PROTECTED]>.
>Yahoo! Groups Links
>
>
>

Victor A. Wagner Jr.      http://rudbek.com
The five most dangerous words in the English language:
               "There oughta be a law" 

Reply via email to