   Pointers to members
  Why are the first adresses the same? But works well...How does the compiler implement it?Thanks to all!   #include <iostream>using namespace std;class myclass{public: void f(){cout<<" f() "<<endl;}; void ff(){cout<<" ff() "<<endl;}; int _i; static int _k;};int myclass::_k = 555; int main(){   myclass mc;   void (myclass::*pf)() = &myclass::f;   void (myclass::*pff)() = &myclass::ff;   int  myclass::*p_i = &myclass::_i;   int  *p_k = &myclass::_k;   (mc.*pf)();   (mc.*pff)();   cout <<  pf << ' '<< pff << ' ' << p_i << ' ' << p_k;}[edited by - dzl on March 25, 2004 7:32:07 AM]
  AFAIK, you should make class members static for those functions you want to pass the pointer.Your getting around this by using the namespace (class) qualifier. (myclass:Look up functors instead. ;quote:Original post by Anonymous Poster  AFAIKWho are you? And why should I trust you?quote:you should make class members static for those functions you want to pass the pointer.sigh... function-pointer.org