#include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char *argv[]) { char **argumentArray = (char **) malloc((argc+1) * sizeof(char*)); int i, j; for(i=0; i<argc; i++) { argumentArray[i] = (char *) malloc((strlen(argv[i])+1) * sizeof(char)); strcpy(argumentArray[i], argv[i]); } for(i=0; i<=argc; i++) { printf("%s\n", argumentArray[i]); } }
Hi. please find the answer above.. In case of any doubts, please ask in comments. If the answer helps you, please upvote. I am in great need of upvotes. Thanks!
Figure 3- Output 3. Modify your code in MyCommand2 to support accommodate variable variable size a...