Question: 2. Populating a fixed size argument array with the values passed through the command line (MyCommand2) Your second deliverable is a C program (MyCommand2.c) that:

 2. Populating a fixed size argument array with the values passed

2. Populating a fixed size argument array with the values passed through the command line (MyCommand2) Your second deliverable is a C program (MyCommand2.c) that: -Populates each entry in the fixed-size argument array with a default value ("defaultArg"). - Updates the corresponding default values for the arguments with the values entered by the user - Prints the arguments -Assume: argumentArray is defined as follows: #define MAX NUM OF ARGS 5 #define MAX ARG SIZE 256 char argumentArray [MAx NUM OF ARGS] [MAX ARG SIZE; The first argument in the argument array is the command itself (argumentArray[0] = argv[0]); o For example: $MyCommand2 Argl Arg?2 Figure 2- argumentArray populated after running: $MyCommand2 Argl Arg2 o Print an error message if the user enters more than 4 arguments (see figure below) My Command2 Arg1 Arg2 rgumentArray[]: MyCommand2 rgumentArray[1]: Argl rgumentArray[2]: Arg2 rgumentArray[3]: defaultArg rgumentArray[4]: defaultArg MyCommand2 Arg1 Arg2 Arg3 Arg4 rgumentArray[0]: MyCommand2 rgumentArray[1]: Argl rgumentArray[2]: Arg2 rgumentArray[3]: Arg3 rgumentArray[4]: Arg4 MyCommand2 Arg1 Arg2 Arg3 Arg4 Arg5 sage MyCommand2 Argl Arg2.. Your arguments exceeded the maximum of arguments (4)

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!