G
Graham Lee
Given a typedef like this:
typedef double LoadsOfArgs(double arg1, double arg2, double arg3, double
arg4);
I can *declare* a function using the typedef:
LoadsOfArgs geoMean;
int main(void)
{
printf("G.M.(1,2,3,4) = %g\n",geoMean(1.0,2.0,3.0,4.0));
exit(EXIT_SUCCESS);
}
but then don't appear to be able to *define* the function in the same way:
LoadsOfArgs geoMean
{
return pow(arg1*arg2*arg3*arg4,0.25);
}
is use of the full function prototype mandated, or is my function
definition wrong?
typedef double LoadsOfArgs(double arg1, double arg2, double arg3, double
arg4);
I can *declare* a function using the typedef:
LoadsOfArgs geoMean;
int main(void)
{
printf("G.M.(1,2,3,4) = %g\n",geoMean(1.0,2.0,3.0,4.0));
exit(EXIT_SUCCESS);
}
but then don't appear to be able to *define* the function in the same way:
LoadsOfArgs geoMean
{
return pow(arg1*arg2*arg3*arg4,0.25);
}
is use of the full function prototype mandated, or is my function
definition wrong?