command line arguments

This is a discussion on command line arguments within the C Programming forums, part of the General Programming Boards category; can anyone tell what is the type of argv, whether it is- pointer to array of pointers or pointer the ...

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

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