Thread: how do i convert a char array to an integer ? (c++)

  1. #1
    Registered User
    Join Date
    Oct 2002
    Posts
    1

    how do i convert a char array to an integer ? (c++)

    please help.
    i need to convert a char array (with a numeric value) to an integer. how do i do that in c++?
    thanks a lot.
    Last edited by mbh; 10-30-2002 at 11:40 PM.

  2. #2
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    I think this is in the faq.

  3. #3
    Registered User
    Join Date
    Oct 2002
    Posts
    8
    use the function atoi(char *)

  4. #4
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    No, use stringstream.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Code review
    By Elysia in forum C++ Programming
    Replies: 71
    Last Post: 05-13-2008, 09:42 PM
  2. char array string > integer
    By luigi40 in forum C Programming
    Replies: 2
    Last Post: 06-03-2004, 11:28 AM
  3. Half-life SDK, where are the constants?
    By bennyandthejets in forum Game Programming
    Replies: 29
    Last Post: 08-25-2003, 11:58 AM
  4. String sorthing, file opening and saving.
    By j0hnb in forum C Programming
    Replies: 9
    Last Post: 01-23-2003, 01:18 AM
  5. simulate Grep command in Unix using C
    By laxmi in forum C Programming
    Replies: 6
    Last Post: 05-10-2002, 04:10 PM