Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rutgers!sunybcs!bingvaxu!leah!uwmcsd1!uwmacc!hobbes!root From: root@hobbes.UUCP (John Plocher) Newsgroups: comp.lang.c Subject: Re: Accessing argc & argv from a functi Message-ID: <185@hobbes.UUCP> Date: Fri, 21-Aug-87 05:04:36 EDT Article-I.D.: hobbes.185 Posted: Fri Aug 21 05:04:36 1987 Date-Received: Sat, 22-Aug-87 18:43:46 EDT References: <22@flmis06.ATT.COM> <28700015@ccvaxa> <853@mcgill-vision.UUCP> Reply-To: root@hobbes.UUCP (John Plocher) Followup-To: comp.lang.c Organization: U of Wisconsin - Madison Spanish Department Lines: 27 +---- der Mouse writes the following in article <853@mcgill-vision.UUCP> ---- | aglew@ccvaxa.UUCP quotes: | >> How does one get at argc and argv from a function? | and writes: | > At McGill I modified crt0 to put argc/argv/envp into globals | Well, I took up the concept +---- Acchh - Pffft! int argc; char **argv; main(ac,av) { argc = ac; argv = av; ... } foo() { if (argc != 2) usage(); } Why hardcode crt0? What does that buy you over this? At least this is portable, doccumented (no black magic done by the startup routine)... -- John Plocher uwvax!geowhiz!uwspan!plocher plocher%uwspan.UUCP@uwvax.CS.WISC.EDU