pointer declaration for data member method 1int m


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

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: pointer declaration for data member method 1int m
Reference No:- TGS0161144

Expected delivery within 24 Hours