Knowing the number of variable arguments.
Alexandre Oliva
aoliva@cygnus.com
Sun May 28 18:18:00 GMT 2000
On May 29, 2000, Gigi Sullivan <sullivan@sikurezza.org> wrote:
> Well, I know that using va_start/va_arg and va_end I can
> scan all the variable arguments list, but what if I'd like
> to know the *number* of the variable arguments?
There's no portable way. That's why functions with variable number of
arguments require at least one argument: so that you can pass in some
clue about the other arguments.
> This is bad, since I cannot know *when* the list is terminated
How about requiring a NULL terminator, as in exec()?
--
Alexandre Oliva Enjoy Guaraná, see http://www.ic.unicamp.br/~oliva/
Cygnus Solutions, a Red Hat company aoliva@{redhat, cygnus}.com
Free Software Developer and Evangelist CS PhD student at IC-Unicamp
oliva@{lsd.ic.unicamp.br, gnu.org} Write to mailing lists, not to me
More information about the Gcc-help
mailing list