Thread: command line arguments

  1. #16
    Registered User
    Join Date
    Aug 2007
    Posts
    16
    my goal is practicing with main(argc,*argv[]) but from what i understand i cannot do it as long as i am not using command line

    getcommandline is a good solution but i just want to use main(argc,*argv[])

    from what i understand there is no such way and i am okey with that

    now can anybody tell me how do i use command line to open my programs please?
    thanks for your time

  2. #17
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Start -> Run, type 'cmd' (WinNT) or 'command' (Win9x)

    Navigate to your exe, ie using cd <dir>

    Launch your app by typing it's name (assuming it's in the current directory), the first argument is the program name, the 2nd argument is whatever comes after it (separated by a space), eg

    Code:
    myapp arg1 arg2 arg3 "this is arg4" arg5 ... argn

  3. #18
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    Quote Originally Posted by benhaldor View Post
    getcommandline is a good solution but i just want to use main(argc,*argv[])
    Argc contains the number of arguments, argv contains the arguments as an array. How many times do I have to tell you that... ?
    "The Internet treats censorship as damage and routes around it." - John Gilmore

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, 02:11 PM