|
Re: Variable-length Argument Lists in C
As I recall, va_arg yields NULL when you try to get passed the final argument.
char *arg;
while ((arg = va_arg()) != NULL) {
...
It's been a while, but that seems about right.
Oh, now I remember. I always passed a list of arguments in the function call ending with NULL.
myfunc (arg1, arg2, arg3, NULL);
So I would know.
Last edited by RaBones; 25th July 2010 at 09:17 AM.
|