c语言将 函数名称 作为参数传递给一个函数

1. 函数定义如下,其中fn,cpyfn为函数名。

1 void
2 GOMP_task (void (*fn) (void *), void *data, void (*cpyfn) (void *, void *),
3        long arg_size, long arg_align, bool if_clause, unsigned flags,
4        void **depend, int priority_arg, void *detach)
5 {

2.  调用方式

1       cpyfn (arg, data);
2       fn (arg);

 

posted @ 2022-11-03 17:17  cofludy  阅读(101)  评论(0编辑  收藏  举报