Possible Duplicate:
Is it possible to have a variadic function in C with no non-variadic parameter?
Is it possible to create a C varargs function with no arguments?
For example:
int foo(...);
I want to do something like the following:
list* create_list(...){
list *mylist = list_create();
void *current_arg = va_arg(void*);
while (current_arg != NULL){
list_add(mylist, current_arg);
current_arg = va_arg(void*);
}
return mylist;
}
No. Variadic functions must have one or more named parameters.
Try it yourself, you'll see something like:
error: ISO C requires a named argument before '...'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With