Command line arguments

This is a discussion on Command line arguments within the C Programming forums, part of the General Programming Boards category; Hey, I am new to writing programs that take command line arguments, and I wonder if you could help out. ...

  1. #1
    Registered User
    Join Date
    Jun 2009
    Posts
    452

    Command line arguments

    Hey,

    I am new to writing programs that take command line arguments, and I wonder if you could help out. I have a program that takes two integers as input. But the command line puts them into argv as strings. Is there a simple way to convert, say, 11111 from a string to the actual number 11111?

    TIA

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    What, you mean using the standard C "convert string to number" functions like strtol?

  3. #3
    Registered User
    Join Date
    Jun 2009
    Posts
    452
    Maybe? Haha I'll take a look, thanks for the tip

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Beginner Needs help in Dev-C++
    By Korrupt Lawz in forum C++ Programming
    Replies: 20
    Last Post: 09-28-2010, 01:17 AM
  2. GradeInfo
    By kirksson in forum C Programming
    Replies: 23
    Last Post: 07-16-2008, 03:27 PM
  3. command line arguments
    By vurentjie in forum C Programming
    Replies: 3
    Last Post: 06-22-2008, 06:46 AM
  4. NULL arguments in a shell program
    By gregulator in forum C Programming
    Replies: 4
    Last Post: 04-15-2004, 10:48 AM
  5. registry, services & command line arguments.. ?
    By BrianK in forum Windows Programming
    Replies: 3
    Last Post: 03-04-2003, 01:11 PM

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