当前位置:网站首页>What is the C language callback function?

What is the C language callback function?

2022-06-21 21:09:00 Lixiaoyao

When it comes to callback functions , Let me start with an analogy , In many scenarios , A customer , I want to cooperate with some game developers with the game project , If you don't know their strength , Ask the way first , And then ask them to design the structure and function in every company , Who can I vote for if I meet the requirements . For customers , What I want is to see if the code you write to us is maintainable , Readability , Extensibility , flexibility , Conciseness , Reusability , Careful consideration of testability and even soundness . In the face of these requirements, the technical strength of developers is more important , Write out what meets the customer's requirements , On the code , Callback functions sometimes play a key role .

 Insert picture description here

The function of callback function :

Callback function is a very important concept in program development , The so-called callback is actually the interface and Convention between different program modules , It is the basic way of software layered design . As long as the use of callback functions can greatly improve the efficiency of programming , So many scenarios are under development , There are some requirements that must be implemented using callback functions . meanwhile , stay C In language , Callback functions can only be implemented using function pointers , such as C++ And other languages can also use pseudo functions or anonymous functions .

What is a callback function ?

Here I quote a passage from the Internet , More understandable :

Callback functions are a very important mechanism , It can be mainly used to realize the layered design of software , So that the work progress of developers of different software modules can be independent , Not limited by time and space , When necessary, only the agreed interface is required ( Or the standard ) Fit together , That is to say C++ perhaps JAVA The so-called interface oriented programming claimed by modern programming languages . At the same time callback

原网站

版权声明
本文为[Lixiaoyao]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/172/202206211926119497.html