What does "..." mean in a C function declaration?

c, function, variadic-functions

Solution

Unspecified/variable number of parameters. To handle such function you have to use the va_list type and va_start, va_arg, and va_end functions:

An example taken from here:

  #include <stdlib.h>
        #include <stdarg.h>
        #include <stdio.h>

        int maxof(int, ...) ;
        void f(void);

        main(){
                f();
                exit(EXIT SUCCESS);
        }

        int maxof(int n args, ...){
                register int i;
                int max, a;
                va_list ap;

                va_start(ap, n args);
                max = va_arg(ap, int);
                for(i = 2; i <= n_args; i++) {
                        if((a = va_arg(ap, int)) > max)
                                max = a;
                }

                va_end(ap);
                return max;
        }

    void f(void) {
            int i = 5;
            int j[256];
            j[42] = 24;
            printf("%d\n",maxof(3, i, j[42], 0));
    }

You can find more details here

Problem

What does this mean? ``` void message(int x, int y, ...) ``` I can't understand what ... is. Can anybody explain?

Original source