Thread: Contents of element

  1. #1
    Registered User
    Join Date
    Mar 2006
    Posts
    11

    Question Contents of element

    The command line arguments to the C main function can be read by accessing the parameters of main, if main has the following signature:
    int main ( int argc, char **argv );
    What is the contents of element argv[0]?

  2. #2
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,005
    If the value of argc is greater than zero, the string pointed to by argv[0] represents the program name; argv[0][0] shall be the null character if the program name is not available from the host environment.
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 01-05-2008, 11:30 PM
  2. Modify an single passed array element
    By swgh in forum C Programming
    Replies: 3
    Last Post: 08-04-2007, 08:58 AM
  3. Linked list question modfiying element contents
    By Axel in forum C Programming
    Replies: 2
    Last Post: 10-17-2005, 04:57 AM
  4. Sorting a 2-dimensional array
    By kmoyle73 in forum C++ Programming
    Replies: 3
    Last Post: 05-05-2004, 01:54 PM
  5. Struct *** initialization
    By Saravanan in forum C Programming
    Replies: 20
    Last Post: 10-09-2003, 12:04 PM