6.Function:
#include <stdio.h>
static int report(int primary, int secondary, char *descriptor)
{
return printf("%s: %d,%d", descriptor, primary, secondary);
}
static int process(int (*p)(int, int, char *))
{
int a =5, b=47;
char *c="aggregate";
/* call report() through the function pointer */
return 0:
}
int main(void)
{
process(report);
return 0;
}
Output:
aggregate: 47,5
□ (*p) (b, a, c);
□ (*p) (report, b, a, c);
□ p.report(b,a,c);
□ p(b,a,c);
□ p->report(b,a,c)
--
FROM 1.147.112.*