Ask Function problem?thanks
<<<<<<<<<<Class.h>>>>>>>>>>
#pragma once
class Class
{
public:
int get_return(int a,int b,int (*compare)());
int Rxgmoral(int a,int b);
void Fun();
};
<<<<<<<<<Class.Cpp>>>>>>>>
#include "Stdafx.h"
#include "Class.h"
int Class::get_return(int a,int b,int(* compare)())
{
return (compare(a,b));
}
int Class::Rxgmoral(int a, int b)
{
return a+b;
}
void Class::Fun()
{
int a;
a=get_return(1,2,&Rxgmoral);
}
error:
e:\mystudio\project\test\test\class.cpp(6) : error C2197: 'int (__cdecl *)(void)' : too many arguments for call
e:\mystudio\project\test\test\class.cpp(17) : error C2276: '&' : illegal operation on bound member function expression
thanks:)