The difference between callback function and normal function

I searched a lot to find out the difference between a normal function and a callback function. Unfortunately, I could not understand. if we need to call a function inside another function, then what is the usefulness of passing it as a parameter to a function using function pointers? Is it possible to call a function passed as a parameter in the form of pointers to functions outside the function in which it is passed as a parameter? if yes, please give me a rough idea of ​​its implementation. Thanks

+5
source share
1 answer

Say you have a function that performs some lengthy operation, such as sending emails. You do not want to wait for completion, so you will give it a callback function that will be called after its completion. This is the main use of callbacks - notification of asynchronous operations. There are other uses.

+1
source

All Articles