More problems with passing functions as arguments.

Patrick Martin pm0 at reef.cis.ufl.edu
Thu Mar 21 15:59:56 AEST 1991


void Function(i)

int i;

{
   printf("\nThe Number Is: %d\n",i);
}

void Pass_Me_A_Function(F)

void (*F) (int);

{
   F(1);
}

main()

{
   Pass_Me_A_Function(Function);
}


This code works fine when compiled with gcc or my compiler at home.
When compiled with some of the older implementations of C it fails.

Is there a way I can get this to run with some of the older versions
of C?

PS: It fails on the declaration of F in Pass_Me_A_Function of
void (*F) (int);

Thanks for the help,
Pat













More information about the Comp.lang.c mailing list