cplusplus.com
C++ : Forum : General C++ Programming : .* and ->* operators
 
cplusplus.com
Information
Documentation
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs


post .* and ->* operators

darkestfright (800)
Just a quick Q:

is

1
2
obj.*memberVariable
ptr->*memberVariable


Equivalent to:

1
2
*(obj.memberVariable)
*(ptr->memberVariable)
firedraco (4744)
No. There is no .* or ->* operator AFAIK. I don't think the top 2 lines would even compile.
guestgulkan (2375)
They are the the pointer to class member dereference operators.

But I think your description/wording is slightly off and should read more like this:
Obj.*PointerToMember
PtrToObj->*PointerToMember


and I don't think the equivalent idea quite works -
Obj.*PointerToMember
is not the same as
*(obj.memberVariable)

Topic archived. No new replies allowed.