Why isn't argv[argc]==(char *)0 ?

dcm dcm at toysrus.uucp
Tue Nov 21 03:21:06 AEST 1989


Well, just to throw in my $.02, K&R #2 states "additionally, the standard
requires that argv[argc] be a null pointer." (p 115)

But, both the 1st and 2nd editions take great care in using argc to
walk thru argv, not argv[argc] != NULL.  I don't think they *ever* do
a (while *argv != NULL)...

Argc should always be correct.  Who cares about argv[argc]?

I remember a VMS system some years ago where argv[0] was "main" or
something idiotic like that.  Err.

	Craig Miller
	..!cs.utexas.edu!ibmaus!auschs!toysrus.austin.ibm.com!dcm
--------
	Craig Miller
	contractor @ IBM Austin
	UUCP: ..!cs.utexas.edu!ibmaus!auschs!toysrus.austin.ibm.com!dcm
	"I don't believe in .signatures."



More information about the Comp.unix.wizards mailing list