我无法解决此错误:代码:
class myClass
{
public:
void callMain() ;
void (*callme)(int a , int b);
}
void myClass::callMain()
{
callSomeApi(callme, <some arguments>); //callme function pointer is passed as argument
}
void (myClass :: *callme) (int a, int b) // it this the correct way to define a function pointer
{
}
我在 Visual Studio 2008 错误 C2470 中收到以下错误:callme 看起来像函数定义,但没有参数列表;跳过明显的身体`
编辑:我的想法:1.我想在类myClass 2中创建成员函数指针。在范围之外定义它。3. 将该函数指针作为参数传递给某个 Api 函数。