In this article : http://publib.boulder.ibm.com/infocenter/macxh开发者_运维技巧elp/v6v81/index.jsp?topic=/com.ibm.vacpp6m.doc/language/ref/clrc03defst.htm
What's means the sentence "In C, a structure member may be of any type except "function returning T" (for some type T)"
Thanks for all the answers!
In C there are no member functions - you can have pointers to functions as members, but you can't declare or define functions in structures:
struct X {
int f(); // illegal in C
int g() { return 42; } // same here
int (*h)(); // pointer to function, fine
};
In the same vein - creating containers for functions - have a look at trampolines * (nested functions is another name). I am NOT endorsing nested functions...
What is a trampoline function?
精彩评论