阅读背景:

c中函数指针的用例

来源:互联网 

One of the common use cases I've come across when I read about function pointers is that they can be used to make a function more flexible, as part of the functionality of the function can be taken in as a parameter. An example for this is qsort where I can make a compare function to decide what is meant by greater and lesser (ascending, descending, is a multiple of,etc) and pass the compare funtion pointer to qsort function.One of the common use cases I've come across wh




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: