Command-line arguments (CLA)

  1. Which function automatically receives command line arguments when the program is run?
  2. Why is the count on the number of CLAs a required parameter when reading in CLAs?
  3. By convention, what should the name of the parameters be to handle CLAs?
  4. What gets stored in to argv[0]?
  5. T/F: when compiling a program with "-o filename", the -o is a CLA but the filename is not.
  6. Write a code fragment that prints out all the command-line arguments
  7. Write a program that requires the user to enter three options: Write appropriate error messages if the user does not enter all three options AND the values for the options.
    e.g. example run:
    	prgm -p bar -n 120 -d 15.31
    	
  8. In the problem above, add code to process each option (-p, -n, -d) such that it prints out information about the option and value.