I want to use my program like this:
./program -I /usr/include/ /usr/bin/ /usr/local/include/ ...
Where the switch can go on and on like in a var args list. How could I do that in C99? Preferably get a something like char **args_list or char *args_list[] that contains all of the things like /usr/include and /usr/bin/.
The output of running the following code:
Executed by
program -I /usr/include/ /usr/bin/ /usr/local/include/Output:
Note that in the code example the initial index is
1. This is because the first pointer in theargvvariable is the name of the program. In this case it would beprogram.