65,189
社区成员




#include <iostream>
#include <cstdio>
class CTest
{
public:
int fun1(int i)
{
std::cout << "fun1" << std::endl;
return 0;
}
int fun2(int i)
{
std::cout << "fun2" << std::endl;
return 0;
}
void testPfun(void)
{
int (CTest::*pFun)(int) = &CTest::fun1;
pFun(1); ------ error C2064: term does not evaluate to a function taking 1 arguments
(int(CTest::*)(int))pFun(1); ----- error C2064: term does not evaluate to a function taking 1 arguments
}
};
int main(int argc, char *argv)
{
CTest o1;
o1.testPfun();
system("pause");
}