R
Rui Maciel
Bill said:I'm not quite understanding here. "Nonzero is not good enough." If there
are no argc's I want the program to terminate with the "usage error"
error. As long as it is nonzero I am happy. I'm stuck on this one.
The OS always passes at least one argument, the program's name, which is available through
argv[0]. The following parameters, if any were passed, will be available in argv[1],
argv[2],...
On a side note, if I'm not mistaken it's possible that the OS may pass a NULL instead of a
string containing the program's name. Nonetheless, argv[0] is always reserved for that task
and the remaining parameters will always be passed from argv[1] forward.
Rui Maciel