I read that the first member of the argv array will always be the program name.
It must be. C and C ++ require that if argc greater than zero, argv[0] must be either a program name or an empty string.
Some systems do not necessarily follow this convention under any circumstances (on Windows, for example, you can use CreateProcess to create a new process and not pass the program name in the command line arguments that are used to populate argc and argv ).
Do you like hanging it?
Of course. If you want, for example, to create another instance of yourself or print the name of your program (for example, in the instructions for use).
Do people never change the first term, because it is useless, or leaves him the best practice?
Do not modify the actual arguments; the next person who comes, probably expects them to be in their original form.
James McNellis
source share