Files
developer-roadmap/roadmaps/c/content/function-pointers--callbacks@yAnN3Fk_S3Nx2USXSR-vq.md
Arik Chakma 274082fd77 feat: clean roadmap content and sync scripts (#10181)
* refactor: clean to roadmap content

* refactor: move shared helpers into scripts/lib
2026-07-28 05:45:17 +06:00

9 lines
927 B
Markdown

# Function pointers & Callbacks
A function pointer stores the address of a function, allowing that function to be called indirectly, passed as an argument, or stored in a data structure, similar to how a regular pointer stores the address of a variable. Callbacks use this to let one function invoke another that is decided at runtime, a pattern used by standard library functions like `qsort`, which takes a comparison function as a callback. This mechanism underlies more advanced patterns in C, including simulating object-oriented dispatch through structs containing function pointers.
Visit the following resources to learn more:
- [@article@Function Pointers](https://www.w3schools.com/c/c_functions_pointers.php)
- [@article@Making Function Pointers Usable In C](https://vandervoord.net/blog/2015/6/2/making-function-pointers-usable-in-c)
- [@video@Function Pointers in C](https://www.youtube.com/watch?v=BRsv3ZXoHto)