I confused when I try to understand the code below. Can anyone explain this hack:
a.*b
Or if a is a pointer to a class:
a->*b
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Both of those operators are used to dereference a pointer-to-member. Unlike regular pointers, pointer-to-members cannot be dereferenced by themselves, but must be applied to an actual object of the type. Those binary operators pick the object (or pointer) in the left hand side and apply the pointer to member to it.