3 ms·
The article is missing at least one useful thing: how to declare a typedef for a function pointer. This can be used both to avoid error-prone duplication of dec
by greenyoda 13y ago
The article is missing at least one useful thing: how to declare a typedef for a function pointer. This can be used both to avoid error-prone duplication of declarations and to simplify excessively complex declarations.
Here's a simple example:
http://en.wikipedia.org/wiki/Typedef#Using_typedef_with_function_pointers http://en.wikipedia.org/wiki/Typedef#Using_typedef_with_func...
Here's a more complex example:
http://www.devx.com/tips/Tip/13829 http://www.devx.com/tips/Tip/13829
Here's a tutorial on how to interpret the complex declarations like the one at the top of the previous example:
http://www.codeproject.com/Articles/7042/How-to-interpret-complex-C-C-declarations http://www.codeproject.com/Articles/7042/How-to-interpret-co...
Here's a discussion about using typedefs for function pointers on StackOverflow:
http://stackoverflow.com/questions/1591361/understanding-typedefs-for-function-pointers-in-c-examples-hints-and-tips-ple http://stackoverflow.com/questions/1591361/understanding-typ...
See also: The Linux command "cdecl":
http://linux.die.net/man/1/cdecl http://linux.die.net/man/1/cdecl
Plus, there's an on-line version:
http://www.lemoda.net/c/cdecl http://www.lemoda.net/c/cdecl
- deleted 13y ago[deleted]
- buttproblem 13y agoThe most useful education I got on reading function pointers is the spiral rule: http://c-faq.com/decl/spiral.anderson.html http://c-faq.com/decl/spiral.anderson.html (I accidentally deleted my reply)
- conradev 13y agoIt's also good to note that these links for further reading are applicable for blocks in Objective-C, which use the same syntax for declaration, only replacing the asterisk '*' with a caret '^'.
- yuvadam 13y agoThere's another interesting discussion here: http://stackoverflow.com/questions/840501/how-do-function-pointers-in-c-work/ http://stackoverflow.com/questions/840501/how-do-function-po...