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);
}