#include <stdio.h>
typedef unsigned int (*FUNCPTR) (void *);
typedef unsigned int FUNC (void *);
typedef struct _hoge {
FUNCPTR pf; // 出来る
FUNC * f1; // 出来る
// FUNC f2; // 出来ない
} hoge;
unsigned int func(void *d)
{
printf("%s(); called\n", (char *)d
); return 0;
}
int main()
{
hoge h;
h.pf = &func; h.pf("h.pf");
h.f1 = &func; h.f1("h.f1");
// h.f2 = &func; h.f2("h.f2");
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp0eXBlZGVmIHVuc2lnbmVkIGludCAoKkZVTkNQVFIpICh2b2lkICopOwp0eXBlZGVmIHVuc2lnbmVkIGludCAgIEZVTkMgICAgICh2b2lkICopOwoKdHlwZWRlZiBzdHJ1Y3QgX2hvZ2UgewogICAgRlVOQ1BUUiAgICAgcGY7IC8vIOWHuuadpeOCiwogICAgRlVOQyAgICAgICogZjE7IC8vIOWHuuadpeOCiwovLyAgICBGVU5DICAgICAgICBmMjsgLy8g5Ye65p2l44Gq44GECn0gaG9nZTsKCnVuc2lnbmVkIGludCBmdW5jKHZvaWQgKmQpCnsKICAgIHByaW50ZigiJXMoKTsgY2FsbGVkXG4iLCAoY2hhciAqKWQpOwogICAgcmV0dXJuIDA7Cn0KCmludCBtYWluKCkKewogICAgaG9nZSBoOwoKICAgIGgucGYgPSAmZnVuYzsgaC5wZigiaC5wZiIpOwogICAgaC5mMSA9ICZmdW5jOyBoLmYxKCJoLmYxIik7Ci8vICAgIGguZjIgPSAmZnVuYzsgaC5mMigiaC5mMiIpOwoKICAgIHJldHVybiAwOwp9