Question: [THIS SHOULD BE WRITTEN IN C++] The first argument, usually called argc, tells the program how many command line arguments were passed to the program
[THIS SHOULD BE WRITTEN IN C++]
The first argument, usually called argc, tells the program how many command line arguments were passed to the program on its invocation. The second argument, argv, is an array of strings containing the arguments themselves.
Write a main which prints out the arguments passed to the program. For example, when I run my program like this:
./prog apples bananas oranges it outputs: Argument #0 is ./prog Argument #1 is apple Argument #2 is bananas Argument #3 is oranges
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
