Search code examples
csyntaxfunctionparameters

In a C function declaration, what does "..." as the last parameter do?


Often I see a function declared like this:

void Feeder(char *buff, ...)

what does "..." mean?


Solution

  • It allows a variable number of arguments of unspecified type (like printf does).

    You have to access the arguments with the va_start, va_arg and va_end functions.

    See http://publications.gbdirect.co.uk/c_book/chapter9/stdarg.html or Where in the C standard variadic functions are described? for more information