c++类型转换方式转不了?
要从 void * 的指针类型转换成函数指针 int (*)() ,但是不管用static_cast还是reinterpret_cast编译都报错。。。
reinterpret_cast报错:
t.cpp:6: error: ISO C++ forbids casting between pointer-to-function and pointer-to-object
static_cast报错:
t.cpp:6: error: invalid static_cast from type `void*' to type `int (*)()'
非得用老式的C类型转换才行?还是gcc编译器的问题???