在C函数指针的使用 [英] Use of function pointer in C
本文介绍了在C函数指针的使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
什么是传递一个函数作为参数传递给另一个函数的时候,我们可以仅仅通过调用该函数使用功能的优势。
What is the advantage of passing a function as an argument to another function when we can use the function just by calling that function.
推荐答案
这是模拟的多态性和/或回调的一种方式。
It's one way to simulate polymorphism and/or callbacks.
一个程序或客户端可能会受益于某些情况下客户端入口点。这是要实现一个共同的方式。它可以用于改善模块化或改善多个实现的物理分离
A program or client may benefit from client entry points in some contexts. This is a common way to achieve that. It can be used improve modularity or improve physical separation of multiple implementations.
这篇关于在C函数指针的使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文