Possible Duplicate:
How to call a function using pointer-to-member-function
Analyzer.h
class Analyzer
{
public :
void viku();
void Bibek();
void vivek();
void (Analyzer::*point)();
Analyzer(){
}
~Analyzer(){
}
};
Analyzer.cpp
using namespace std
#include"Analyzer.h"
void Analyzer::viku(){
cout<<"Hello viku";
}
void Analyzer::vivek(){
point =&Analyzer::viku;
Bibek();
}
void Analyzer::Bibek(){
point();//Errror
cout<<"Bibek";
}
During compilation it shows the following error:
error C2064: term does not evaluate to a function taking 0 arguments.
Can anyone please tell me how to avoid this?
using namespacein header files, better yet: don't use it at all. It might cause naming conflicts.point();doesn't work from a member function whereviku();would. +1 for a reasonable question.