Results 1 to 4 of 4

Thread: Another completely ignorant question (about arguments)

  1. #1

    Thread Starter
    Member filburt1's Avatar
    Join Date
    Aug 1999
    Posts
    6,935

    Another completely ignorant question (about arguments)

    How can I read what arguments what passed to my proggie? In Java, it's public static void main(String[] args), so is it int main(char *args) in C++?

  2. #2
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    Code:
    int main(int argc, char* argv[])
    {
    program-statements
    }
    argc

    An integer specifying how many arguments are passed to the program from the command line. Because the program name is considered an argument, argc is at least 1.

    argv[x] contains argument.
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  3. #3

    Thread Starter
    Member filburt1's Avatar
    Join Date
    Aug 1999
    Posts
    6,935
    Cool, thanks.

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    In the standard, argv[argc] is defined to be NULL
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width