Path: utzoo!attcan!uunet!husc6!bloom-beacon!tut.cis.ohio-state.edu!osu-cis!dsacg1!dsacg3!nts0302 From: nts0302@dsacg3.UUCP (Bob Fisher) Newsgroups: comp.lang.c Subject: Re: Variable argument lists. Message-ID: <859@dsacg3.UUCP> Date: 11 May 88 11:48:39 GMT References: <14139@brl-adm.ARPA> Organization: Defense Logistics Agency Systems Automation Center, Columbus Lines: 26 In article <14139@brl-adm.ARPA>, bates%falcon.dnet%fermat@bru.mayo.edu (Cary Bates) writes: > > > > Does anybody know (or care) why in ANSI standard C when > using a variable length argument list, there is no way to > determine how many arguments where passed into the function? I have simply tested optional arguments equal to null/zero/whatever (depending on type). The compiler initializes the function's copy of the arugment according to type class. This means that the argument cannot pass the save value to which the field is initialized. It also means that EVERY time you exit the function, you must reset the function's copy of the arugment. The next time the function is called, the value is still initialized if the argument is omitted. Admittedly, I have used this technique only with the last argument in the list. I don't know if it will work with your compiler or if it will be portable. -- - - - - - - - - - - - - - - - - - - - - - - - Bob Fisher @ Defense Logistics Agency Systems Automation Center, Columbus, OH UUCP: {uunet!gould,cbosgd!osu-cis}!dsacg1!bfisher Phone: 614-238-9071 (Autovon 850-9071)