How do you pass a function as a parameter in C?

前端 未结 7 2471
梦谈多话
梦谈多话 2020-11-22 04:08

I want to create a function that performs a function passed by parameter on a set of data. How do you pass a function as a parameter in C?

7条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-22 04:50

    You need to pass a function pointer. The syntax is a little cumbersome, but it's really powerful once you get familiar with it.

提交回复
热议问题