>void funk();
>void funk ( *var1, *var2, *var3)
Mixing old style declarations and new style definitions is a bad idea. When your prototype has an empty parameter list, you are not saying that it takes no arguments. You are saying that it takes an unknown number and type of arguments, which is most certainly not what you intended I imagine.
And I would recommend against trying to pass a different number of arguments than you tell the function to expect. If you really want to a variable number of arguments, write a function with a variable length argument list:
Code:
#include <stdio.h>
#include <stdarg.h>
void funk ( int narg, ... );
int main ( void )
{
int var1, var2, var3;
funk ( 1, &var1 );
funk ( 2, &var2, &var3 );
printf ( "%d\n%d\n%d\n", var1, var2, var3 );
return 0;
}
void funk ( int narg, ... )
{
va_list args;
int i = 0;
va_start ( args, narg );
while ( --narg >= 0 )
*va_arg ( args, int * ) = i++;
va_end ( args );
}