What is the advantage of using function pointers in C for implementing callback functions?

  • Allows dynamic callback selection
  • Enhances code modularity
  • Reduces code redundancy
  • Simplifies debugging
Function Pointers allow dynamic selection of callback functions in C, which is useful in scenarios where you need to change callbacks at runtime without modifying the main code. It reduces code redundancy and enhances code modularity, but it might make debugging more challenging due to indirection.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *