define pointers to functions

来源: 2011-09-19 10:48:55 [旧帖] [给我悄悄话] 本文已被阅读:

void testpf() {
 int (*ptMain)() = main;

 void (*ptFoo)() = Foo;

 ptFoo();

 printf("main() is at 0x%x\\n", (unsigned long)ptMain);
 printf("Foo() is at 0x%x\\n", (unsigned long)ptFoo);
}