Pointer declaration for data member: Method 1:
int M::* px; // This is known as pointer-to-member declared for class member of A.
px = &M::x;//The pointer px is pointing to the data member m in the class A. int S1;
S1=m.*px;
Method 2: M *pm; pm=&m; int M::*py; py=&M::y; int S2;
S2=pm->*py;//pointer-to-object->*pointer-to-member function