回复 2楼 rjsp
taskchange(fp,task_0(33));在VC下运行过的
task_0函数被解释为函数指针 我想能不能连参数一起传递过去 在VC试了一次 还可以
虽然还不是很理解C的参数传递是传递参数的副本这样写可以用就先这样呗 等理解了 就好说了
虽然还不是很理解C的参数传递是传递参数的副本
2013-04-03 14:55
2013-04-03 15:00
程序代码:
typedef void pF(char);
pF change_fun()
{
return task_0;
}
程序代码:
void (*change_fun())(char)
{
return task_0;
}

2013-04-03 15:17
2013-04-03 16:24
我就想在一个函数里实现 函数指针指向另一个函数
然后我来操作这个指针就可以了 不想去调用函数 比较麻烦啊
2013-04-03 16:27
2013-04-03 16:43
程序代码:extern void (*get_hello_world_function(void))(void);
int main(void)
{
get_hello_world_function()();
return 0;
}
程序代码:#include <stdio.h>
static void hello_world(void)
{
printf("Hello, world!\n");
}
extern void (*get_hello_world_function(void))(void)
{
return hello_world;
}

2013-04-03 18:19
2013-04-03 22:43
2013-04-03 22:46

2013-04-03 22:52