Simple question about string type

Discussion in 'C++' started by peter_k, Nov 9, 2005.

  1. peter_k

    peter_k Guest

    Hi

    In my program i have:

    string s;
    int i;

    how can i easily add integer type to s ??

    for example if i have int i = 5, i want to have after this string s =
    "5"
     
    peter_k, Nov 9, 2005
    #1
    1. Advertising

  2. peter_k

    Guest

    , Nov 9, 2005
    #2
    1. Advertising

  3. peter_k

    Greg Comeau Guest

    In article <>,
    peter_k <> wrote:
    >In my program i have:
    >
    >string s;
    >int i;
    >
    >how can i easily add integer type to s ??
    >
    >for example if i have int i = 5, i want to have after this string s =
    >"5"


    Check out http://www.comeaucomputing.com/techtalk/#noitoa
    --
    Greg Comeau / Celebrating 20 years of Comeauity!
    Comeau C/C++ ONLINE ==> http://www.comeaucomputing.com/tryitout
    World Class Compilers: Breathtaking C++, Amazing C99, Fabulous C90.
    Comeau C/C++ with Dinkumware's Libraries... Have you tried it?
     
    Greg Comeau, Nov 11, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. heyo
    Replies:
    3
    Views:
    930
    Dan Pop
    Apr 1, 2004
  2. pete
    Replies:
    4
    Views:
    809
    Dan Pop
    Apr 2, 2004
  3. Replies:
    0
    Views:
    395
  4. Yevgen Muntyan

    #define ALLOCIT(Type) ((Type*) malloc (sizeof (Type)))

    Yevgen Muntyan, Feb 9, 2007, in forum: C Programming
    Replies:
    10
    Views:
    919
    Yevgen Muntyan
    Feb 13, 2007
  5. ankur
    Replies:
    1
    Views:
    12,878
    Jan =?UTF-8?B?VGhvbcOk?=
    Aug 27, 2007
Loading...

Share This Page