[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Is it perfectly to pass argv[] this way to function ?



Elizabeth Barham wrote:

> The only thing that is troubling is the (**argv != NULL) which assumes
> that the last string is a NULL string (the first character is NULL),
> as opposed to using the count (argc), which may not be the case (it's
> not here).

He didn't write "**argv != NULL", he wrote "*argv != NULL" -- in other
words, not "last argument is a null string", but "the last pointer in
the argv array is a NULL". Which is a common behavior (both gcc 2.95 and
Microsoft Visual C++ do it, at least), though as I wrote previously, I'm
not sure it's in the C89 standard. I agree with you that using argc to
control the loop is preferable, in any case.

Craig

Attachment: pgpTQAhthKjy4.pgp
Description: PGP signature


Reply to: