13 ms·
What a C program can do with a function pointer
- greenyoda 13y agoWhile from a syntactic point of view, the statement "there is almost nothing you can do in C with a function pointer" may be technically correct, there are all sorts of useful things you can do with them which the article could have mentioned in more detail: writing generic functions via call-backs, low-level object oriented programming, replacing production APIs with "mock objects" for testing, etc. I use them in my C code quite frequently.