[Top][All Lists]

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

Re: [bug-gnulib] Re: getopt and Solaris 10

From: Larry Jones
Subject: Re: [bug-gnulib] Re: getopt and Solaris 10
Date: Tue, 10 May 2005 11:21:43 -0400 (EDT)

Derek Price writes:
> Okay, looking at that in C89 now, but just out of curiosity, if argv
> needs to be NULL terminated, what's the point of argc?

I believe it was added for convenience back in the dark ages.  All the
Unix exec functions require a null-terminated argument list (and don't
have an explicit argument count), so argv has naturally always been null
terminated.  (And the C Standard codified that behavior: at program
startup, argv[argc] is required to be null.)

-Larry Jones

I don't think that question was very hypothetical at all. -- Calvin

reply via email to

[Prev in Thread] Current Thread [Next in Thread]