Ignoring that the prototype you gave is illegal because you need at least one non-variable argument--to know where the variable arguments start--you can access the variable arguments with the macros in stdarg.h:
Code:
#include <stdio.h>
#include <stdarg.h>
void func ( int n, ... )
{
va_list args;
int sum = 0;
/* Initialize the variable argument list */
va_start ( args, n );
while ( --n >= 0 )
sum += va_arg ( args, int );
printf ( "Total sum: %d\n", sum );
/* Clean up the variable argument list */
va_end ( args );
}
int main ( void )
{
func ( 5, 1, 2, 3, 4, 5 );
return 0;
}