Xref: utzoo comp.unix.wizards:19345 comp.std.c:2087 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!wuarchive!wugate!uunet!mcsun!hp4nl!orcenl!bengsig From: bengsig@oracle.nl (Bjorn Engsig) Newsgroups: comp.unix.wizards,comp.std.c Subject: Why isn't argv[argc]==(char *)0 ? Message-ID: <547.nlhp3@oracle.nl> Date: 15 Nov 89 16:23:27 GMT Reply-To: bengsig@oracle.nl (Bjorn Engsig) Followup-To: comp.unix.wizards Organization: ORACLE Europe, The Netherlands Lines: 19 Sorry if this is discussed often - I don't normally read c.u.w. The execv family of system calls all have char *argv[] as their second parameter, and you are required to put an endmarker as (char *)0 in it. On the other hand, main has int argc and char *argv[] but here, the endmarker has disappeared. Has it ever been considered to change the defi- nition of main such that it will always be true that argv[argc] == (char *)0 or to change the execv's to use argc and not an endmarker. Is it due to the fact that main() is a C-thing whereas exec() is a Unix thing, and they therefore are incompatible? If this is the case, why isn't there a system() counterpart in the scope of C with the same parameters as main()? It is probably much too late to change anything, but I would just like to know if this has ever been considered. -- Bjorn Engsig, Domain: bengsig@oracle.nl, Path: uunet!mcsun!orcenl!bengsig USA Domain: bengsig@nlsun1.oracle.com