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

Assignment Help:

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


Related Discussions:- Pointer declaration for data member

Define register variables - low level programming, Define Register Variable...

Define Register Variables - Low Level Programming? The Register variables are a special case of an automatic variable. The Automatic variables are allocated storage in the memo

String-classes-constructors and member functions, Objective Using C++ s...

Objective Using C++ string, classes, constructors and member functions. Task A Write a program (book.cpp) to store a list of book titles and the published dates. Your pro

Assigment Help, I need help in the C++ programming assignment. I can send t...

I need help in the C++ programming assignment. I can send the files the assignment is times 3hrs.

Arrays, how to avoid duplicates strings in an array

how to avoid duplicates strings in an array

What are user defined data types, Q: What are User Defined data types? ...

Q: What are User Defined data types? C supports an extraordinary feature known as "type definition" that permits users to define an identifier that would represent an existing

Define structures in c++, Structures A structure is a user-defined data...

Structures A structure is a user-defined data type, which may have different data types as its members. Creating a structure is a two-part process. First, a structure template

Stone game, how to write a c program for stone game

how to write a c program for stone game

C program to remove vowels in sentence , C program to remove vowels in sent...

C program to remove vowels in sentence : void main() {                 char  str[100];                 int n;                 printf("enter string\n");

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd