programming challenge (silly)

Rick Schubert rns at se-sd.sandiego.ncr.com
Tue Mar 28 02:19:16 AEST 1989


In article <12145 at haddock.ima.isc.com> karl at haddock.ima.isc.com (Karl Heuer) writes:
>In article <1859 at se-sd.sandiego.ncr.com> rns at se-sd.sandiego.NCR.COM (Rick Schubert(AEP)) writes:
>>A value [for argc] of 0 indicates that the program name is not available.
>>This is allowed by the soon-to-be ANSI Standard.

>Actually, the sentence that includes "program name is not available" in the
>pANS refers to the case argc > 0 && argv[0] == "".  It's true that the pANS
>also allows argc == 0 && argv[0] == NULL, but it doesn't say what this is
>intended to mean.

I believe that
	argc == 0 && argv[0] == NULL
is intended for the case where the implementation has no access to
the command line (or there is no command line), whereas
	argc > 0 && argv[0] == ""
is intended for the case where the implementation has access to the command
line but not to the program name.

-- Rick Schubert (rns at se-sd.sandiego.NCR.COM)



More information about the Comp.lang.c mailing list