Question: The ` treasure _ main.c ' program is run with command line parameters like ` > . / treasure _ main map 1 . tm
The treasuremain.c program is run with command line parameters like
treasuremain maptm How is the file name maptm 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 as
the string maptm
X The argc parameter will have value and argv will be a
pointer to the string maptm
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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
