converting string to number

This is a discussion on converting string to number within the C Programming forums, part of the General Programming Boards category; let's say i have: int x, y; from the command line, say the user types "program -w -t -y 566 ...

  1. #1
    Unregistered
    Guest

    Exclamation converting string to number

    let's say i have:
    int x, y;

    from the command line, say the user types "program -w -t -y 566 -o 123 -p" how can i get x = 566 and y = 123 ?

  2. #2
    Registered User PutoAmo's Avatar
    Join Date
    Mar 2002
    Posts
    72
    Code:
    int atoi (const char *string);

  3. #3
    Unregistered
    Guest
    thanks so much. didn't know that function existed in C..... i started with C++, maybe i should've started with C first... =)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. OOP Question DB Access Wrapper Classes
    By digioz in forum C# Programming
    Replies: 2
    Last Post: 09-07-2008, 04:30 PM
  2. adding a number to a number
    By bigmac(rexdale) in forum C Programming
    Replies: 11
    Last Post: 10-24-2007, 12:56 PM
  3. Message class ** Need help befor 12am tonight**
    By TransformedBG in forum C++ Programming
    Replies: 1
    Last Post: 11-29-2006, 10:03 PM
  4. Classes inheretance problem...
    By NANO in forum C++ Programming
    Replies: 12
    Last Post: 12-09-2002, 02:23 PM
  5. Warnings, warnings, warnings?
    By spentdome in forum C Programming
    Replies: 25
    Last Post: 05-27-2002, 06:49 PM

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