command line arguments

This is a discussion on command line arguments within the C Programming forums, part of the General Programming Boards category; please can anyone tell me whether i can use command line arguments in c on windows xp if so how...

  1. #1
    Registered User
    Join Date
    Aug 2007
    Location
    dehradun
    Posts
    5

    Unhappy command line arguments

    please can anyone tell me whether i can use command line arguments in c on windows xp
    if so how

  2. #2
    Registered User
    Join Date
    Jul 2006
    Posts
    162
    you just posted a thread on this.... don't post the same thread twice!
    the answer is YES.

    how:

    start>run>"cmd"
    then...

    cd c:\path\to\file\
    then...

    bla.exe ARG1 ARG2
    --------------------------

    bla.exe would be from your bla.c which would have

    int main(argc, *argv[])

    argc <-- number of arguments
    argv <-- the arguments


    process accordingly...

    http://publications.gbdirect.co.uk/c...s_to_main.html
    http://www.d.umn.edu/~gshute/C/argv.html
    Last edited by simpleid; 08-15-2007 at 09:05 AM.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,853
    Same as here - command line arguments
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

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, 02:17 AM
  2. GradeInfo
    By kirksson in forum C Programming
    Replies: 23
    Last Post: 07-16-2008, 04:27 PM
  3. command line arguments
    By vurentjie in forum C Programming
    Replies: 3
    Last Post: 06-22-2008, 07:46 AM
  4. NULL arguments in a shell program
    By gregulator in forum C Programming
    Replies: 4
    Last Post: 04-15-2004, 11:48 AM
  5. registry, services & command line arguments.. ?
    By BrianK in forum Windows Programming
    Replies: 3
    Last Post: 03-04-2003, 02:11 PM

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