Can you tell what the following declaration means?
void (*p[10]) (void (*)() );
Only few programmers can tell that p is an "array of 10 pointers to a function returning void and taking a pointer to another function that returns void and takes no arguments." The cumbersome syntax is nearly indecipherable. However, you can simplify it considerably by using typedef declarations. First, declare a typedef for "pointer to a function returning void and taking no arguments" as follows:
typedef void (*pfv)();
Next, declare another typedef for "pointer to a function returning void and taking a pfv" based on the typedef we previously declared:
typedef void (*pf_taking_pfv) (pfv);
Now that we have created the pf_taking_pfv typedef as a synonym for the unwieldy "pointer to a function returning void and taking a pfv", declaring an array of 10 such pointers is a breeze:
pf_taking_pfv p[10];
Aug 28, 2009
Aug 13, 2009
eclipse + visual studio
http://neora.javaeye.com/blog/192626
http://groups.google.com/group/bmw-network-security-visualization/browse_thread/thread/6a7367cb596eb30d/10a9038a8d94face?lnk=gst&q=enviroment+variables#10a9038a8d94face
http://www3.ntu.edu.sg/home/ehchua/programming/howto/Eclipse_cpp_HowTo.html
http://groups.google.com/group/bmw-network-security-visualization/browse_thread/thread/6a7367cb596eb30d/10a9038a8d94face?lnk=gst&q=enviroment+variables#10a9038a8d94face
http://www3.ntu.edu.sg/home/ehchua/programming/howto/Eclipse_cpp_HowTo.html
Subscribe to:
Comments (Atom)