Pointer declaration for data member, C/C++ Programming

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;


Method 2: M *pm; pm=&m; int M::*py; py=&M::y; int S2;

S2=pm->*py;//pointer-to-object->*pointer-to-member function

Posted Date: 9/20/2012 8:02:43 AM | Location : United States

Related Discussions:- Pointer declaration for data member, Assignment Help, Ask Question on Pointer declaration for data member, Get Answer, Expert's Help, Pointer declaration for data member Discussions

Write discussion on Pointer declaration for data member
Your posts are moderated
Related Questions
Define Commonly Used Built-in Library Functions? Comprise opened a file pointer you will desire to use it for either input or output. The C language supplies a set of functions

Write a program that performs character processing on 10 characters read in from a file, and writes the results to output files. Do NOT use loops or arrays to solve this problem. N

Operators in C++: All C operators are valid operators in C++ also.  Besides C++ has developed some new operators like Operators and their Expression: 1.      Logical op

Ravi is a newbie to the programming and while learning the programming language he came to know the following rules: · Each program must start with ''''''''{'''''''' and end wi

How would I use variables of a C++ object within a Lua function, and then call the Lua function from C++ code?

#solution for decode the code for smuglers

exemples of many to many

make a marksheet of 2 student with 5 subject