64,648
社区成员
发帖
与我相关
我的任务
分享
void callervoid(*ptr)(int TotalValue,...)
{
va_list args;
va_start(args, TotalValue);
//处理这些数据……
va_end(args);
}
void caller(void(*ptr)(int),int s)
{
ptr(s); /* 调用ptr指向的函数 */
}
void func(int p1, int p2, int p3 ,char c)
{
int t = p1+p2+p3+c ;
}
void caller(void(*ptr)(int,int,int,char),int p1,int p2,int p3,char c)
typedef void( *ptr)( int s );
void caller(ptr fun,int s)
{
fun(s); /* 调用ptr指向的函数, s是函数参数 */
}
void func(int s)
{
ShowMessage(IntToStr(s));
}
int test()
{
caller(func, 1); /* 传递函数地址到调用者 */
return 0;
}