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.
Loading...
Related Quiz
- You are tasked with writing a C function to calculate the factorial of a number. Which programming technique would be most suitable for this task?
- In C, a structure member with a specified width is known as a ________.
- What is the significance of using pointers to arrays in C?
- What is the purpose of the feof function in file handling in C?
- A pointer in C holds the ________ of a variable.