Path: utzoo!mnetor!uunet!husc6!tut.cis.ohio-state.edu!lvc From: lvc@tut.cis.ohio-state.edu (Lawrence V. Cipriani) Newsgroups: comp.lang.c Subject: Re: Variable argument lists. Message-ID: <12948@tut.cis.ohio-state.edu> Date: 11 May 88 02:37:16 GMT References: <14139@brl-adm.ARPA> <3569@ece-csc.UUCP> Organization: Ohio State Computer & Info Science Lines: 26 Summary: don't need count or format string In article <3569@ece-csc.UUCP>, jnh@ece-csc.UUCP (Joseph Nathan Hall) writes: > 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? * * That's because in theory one of the "fixed" arguments in your function's * argument list should indicate, either directly with a count, or indirectly * (like printf), how many arguments follow in the variable-length portion * of the argument list. * Nope. For example, it is perfectly legal to have: p = cat(s1, s2, ..., sn, (char *)0); /* pseudo C */ where all the si are strings. There is no count passed, and there is not a printf like format argument. cat() can be called with however many strings (si) you want, even 0. -- Larry Cipriani, AT&T Network Systems and Ohio State University Domain: lvc@tut.cis.ohio-state.edu Path: ...!cbosgd!osu-cis!tut.cis.ohio-state.edu!lvc (weird but right)