hi ,
while was programming , i confronted a problem.
i can compile it under windows VC++,however i can not compile it under linux with g++Code:#include<iostream.h> class sample { int x,y; public: sample(int a,int b) {x=a; y=b; } int getx() { return x; } int gety() { return x+y; } }; int main() { int (sample::*fp)(); fp=sample::getx; sample s(2,5); int v =(s.*fp)(); fp=sample::gety; int t=(s.*fp)(); cout<<"v="<<v<<",t="<<t<<endl; return 0; }
can someone find the answer..
thanks.