64,654
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
int fun()
{
printf("fun runing\n");
}
int main(int argc, char *argv[])
{
void *pf;
pf=fun;
((int(*)())pf)();
return 0;
}
An rvalue of type “pointer tocv T,” where T is an object type, can be converted to an rvalue of type
“pointer tocvvoid.” The result of converting a “pointer to cv T” to a “pointer tocvvoid” points to the
start of the storage location where the object of typeTresides, as if the object is a most derived object (1.8)
of typeT(that is, not a base class subobject).