|
|
|
|
|
by TorKlingberg
5096 days ago
|
|
The second solution looks like a good old callback to me. The other two are just complicating things with additional state. In general, I try to avoid function pointers i C unless I am sure it makes the code clearer. It is often difficult to debug code that tries to be clever with them. Like preprocessor macros they are powerful, but tempting to misuse. |
|