Original Post
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]