Prototyping Functions with Variable Parameters

Some functions, such as the printf library function, can handle a variable number of parameters. This capability can make functions more flexible. As earlier examples have shown, the printf function can take one parameter or several, depending on how many values you need to print.

To declare a function with a variable number of parameters, end the parameter list with a comma and an ellipsis (,...). The following prototype, for example, declares that the sample function expects at least one int-type para-meter and zero or more additional parameters:

void sample( int a,... );

The ellipsis stands for an unspecified number of parameters with types that are also unspecified. The parameter list in the function header should follow the same pattern.

Don't declare a variable number of parameters unless it's necessary. Giving this sort of prototype for a function that takes a fixed number of parameters defeats the prototype's main purpose. QuickC can't perform type checking for para-meters you leave out of a prototype.