What are pointer-to-members in C++? Give their syntax.
Answer / Iqbal Ahmed
Pointer-to-members, also known as member pointers, are used to access members of a class indirectly. They have the form &Class::member and can be accessed with -> operator, like ptr->memberName. The syntax for defining a pointer-to-member is: Class* const CLASS::*ptr_to_member;
| Is This Answer Correct ? | 0 Yes | 0 No |
Why the usage of pointers in C++ is not recommended ?
How did c++ get its name?
What is the limitation of cin while taking input for character array?
What are the different types of polymorphism in c++?
Is atoi safe?
What language is a dll written in?
Write a corrected statement in c++ so that the statement will work properly. if (x = y) x = 2*z;
Is vector a class in c++?
Why do C++ compilers need name mangling?
What are the 4 types of library?
What are friend functions in C++?
How can I disable the "echo" feature?