#include <math.h>
#include <stdio.h>
#include <stdlib.h>
int *swap(int *,int *);
typedef int* (*callback)(int *,int *);
int * func(callback,void *,void *);
int main(int argc, char const *argv[])
{
int c=4,d=5;
printf("input your number:\n\r");
scanf("%d,%d",&c,&d);
printf("c=%d,d=%d\n",c,d );
int *p =func(&swap,&c,&d);
printf("c=%d,d=%d\n",c,d );
}
int *swap(int *a,int *b){
int temp = *a;
*a=*b;
*b =temp;
return a;
}
int * func(callback call,void *a,void*b){
printf("execute callback function result:\n");
return call((int *)a,(int *)b);
}