Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
Function pointer is the functions name.
It is mainly used when we are using an API that takes a function prototype as an argument. This is very common when creating a task, a thread, or a process in my applications. Another example when registering an ISR or a call back.
--
Amr
function pointer is used when we don't (need to) know the name of the function in advance.
Just like an int pointer, where it can point to any int, a function pointer can point to any function with the same signature (i.e. return type and parameters).
We can use typedef to declare a function pointer type and use that for passing functions as parameters to functions (for ISR, Callbacks, task entry point, signal handler) in a easily readable way.
Function pointers allow a lot of flexibility in code development and creating libraries without knowing the exact end product.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.