How to convert a STD string object to an integer?

Discussion in 'C++' started by silverburgh.meryl@gmail.com, Feb 20, 2007.

  1. Guest

    Hi,

    If I have a std string object , how to convert a STD string object to
    an integer?

    Thank you.
     
    , Feb 20, 2007
    #1
    1. Advertising

  2. wrote:
    > If I have a std string object , how to convert a STD string object to
    > an integer?


    Please see the FAQ and/or the news archives. Always do that before
    posting, please.
     
    Victor Bazarov, Feb 20, 2007
    #2
    1. Advertising

  3. Guest

    On Feb 20, 3:37 pm, "Victor Bazarov" <> wrote:
    > wrote:
    > > If I have a std string object , how to convert a STD string object to
    > > an integer?

    >
    > Please see the FAQ and/or the news archives. Always do that before
    > posting, please.


    Thanks. I found this: http://www.cplusplus.com/reference/clibrary/cstdlib/atoi.html
    But it takes a char* c, not an STD string object.
     
    , Feb 20, 2007
    #3
  4. red floyd Guest

    wrote:
    > On Feb 20, 3:37 pm, "Victor Bazarov" <> wrote:
    >> wrote:
    >>> If I have a std string object , how to convert a STD string object to
    >>> an integer?

    >> Please see the FAQ and/or the news archives. Always do that before
    >> posting, please.

    >
    > Thanks. I found this: http://www.cplusplus.com/reference/clibrary/cstdlib/atoi.html
    > But it takes a char* c, not an STD string object.
    >


    As Victor told you, read the FAQ http://www.parashift.com/c -faq-lite

    In particular, FAQ 39.2
    http://www.parashift.com/c -faq-lite/misc-technical-issues.html#faq-39.2
     
    red floyd, Feb 20, 2007
    #4
    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. Peter Jansson
    Replies:
    5
    Views:
    6,318
    Ivan Vecerina
    Mar 17, 2005
  2. Fei Liu
    Replies:
    9
    Views:
    447
  3. Jeffrey Walton
    Replies:
    10
    Views:
    943
    Mathias Gaunard
    Nov 26, 2006
  4. Replies:
    3
    Views:
    8,807
  5. Sam Roberts
    Replies:
    2
    Views:
    111
    Carlos
    Nov 26, 2004
Loading...

Share This Page