Is there any standard for the format of a program argument?
2 answers
-
Yes.
-
Usually yes, it can also be empty or some other identifying string or even
NULL
(see my appendix). You can also changeargv[0]
to something else from within the program. -
C (and C ++) specifications.
You also missed one: the last element in argv
always NULL
, that is, argv[argc]
always will be NULL
.
In the C11 spec, this is in Β§5.1.2.2.1. Launching the program.
In the C ++ 11 specification, its main function is Β§3.6.1.
+6
source to share