Still string problems

This is a discussion on Still string problems within the C++ Programming forums, part of the General Programming Boards category; I am still having problems so I have decided to use another route that I cannot figure out :-( how ...

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    7

    Still string problems

    I am still having problems so I have decided to use another route that I cannot figure out :-( how do I convert string to int?

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    12
    have you tryed using pointers? im just guessing, dont know the whole story on this
    THE Dark_Knight_506

  3. #3
    Registered User
    Join Date
    Oct 2001
    Posts
    2,934
    atoi() is one possibility.

    Code:
    #include <stdlib.h>
    int main()
    {
       char cnum[33] = "44444";
       int num;
    
       num = atoi(cnum);
       cout << "num:" << num << endl;
       return 0;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C++ ini file reader problems
    By guitarist809 in forum C++ Programming
    Replies: 7
    Last Post: 09-04-2008, 06:02 AM
  2. RicBot
    By John_ in forum C++ Programming
    Replies: 8
    Last Post: 06-13-2006, 06:52 PM
  3. Compile Error that i dont understand
    By bobthebullet990 in forum C++ Programming
    Replies: 5
    Last Post: 05-05-2006, 09:19 AM
  4. io stream and string class problems
    By quizteamer in forum C++ Programming
    Replies: 2
    Last Post: 04-25-2005, 12:07 AM
  5. Linked List Help
    By CJ7Mudrover in forum C Programming
    Replies: 9
    Last Post: 03-10-2004, 09:33 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21