我想通过具有未知参数的函数指针调用函数。存储输入参数和函数并稍后运行。call_user_func_array
像在php中的一些东西
例如:
// example function definition
void foo(int arg1, const char *arg2,const char *arg3){
//some other code
}
void bar(int arg1, int arg2){
//some other code
}
// function definition
void store_function_call(int param,void *function,... args){
// store param , function, and other arguments
// in php save to global variable for use later
}
void call_later(){
// execute stored param, function, arguments
// in PHP use call_user_func_array
}
// use:
int main(){
store_function_call(10,bar,4,5);
// store_function_call(5,foo,5,"yyy","sss");
call_later();
}