Question: The ` treasure _ main.c ' program is run with command line parameters like ` > . / treasure _ main map 1 . tm

The `treasure_main.c' program is run with command line parameters like
`>./treasure_main map1.tm'. How is the file name `map1.tm' made
available in the `main()' function?
-() The `fscanf()' function is used to read the command line as the
user types it in.
-() The global variable `args' will be an array with `args[0]' as
the string `map1.tm'
-(X) The `argc' parameter will have value 2 and `argv[1]' will be a
pointer to the string `map1.tm'
-() The `getenv()' function is used to extract the command line
arguments from the environment.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!