Thread: command line arguments

  1. #1
    Registered User
    Join Date
    Jun 2002
    Posts
    2

    command line arguments

    can anyone tell what is the type of argv,
    whether it is-
    pointer to array of pointers
    or
    pointer

    the declaration char *argv[], means aray of char pointers

  2. #2
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,380
    The variable argv is an array of pointers to string.

    Code:
    int main (int argc, char **argv)
    {
        /* Print first string in argv, which is name of program */
        printf ("%s\n", argv [0]);
        return 0;
    }

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. Replies: 10
    Last Post: 09-27-2005, 01:49 PM
  5. NULL arguments in a shell program
    By gregulator in forum C Programming
    Replies: 4
    Last Post: 04-15-2004, 11:48 AM
Website Security Test