I’m new to C and Linux. When run a compiled program in terminal, like:
./myProg --myCommand1
then myProg will do the job according to the command “myCommand1”. I’d like add several commands to the myProg. I’m not sure if char *argv[] can be used for this.
Thanks.
It can be used.
argv[1]is the first command,argv[2]is the second, etc.