The following two expressions are equivalent:
a->b
(*a).b
(subject to operator overloading, as Konrad mentions, but that’s unusual).
More Related Contents:
- address of operator and pointer operator [closed]
- How to pass objects to functions in C++?
- How does dereferencing of a function pointer happen?
- determine size of array if passed to function
- Dynamically allocating an array of objects
- What is the size of a pointer?
- Why does int pointer ‘++’ increment by 4 rather than 1?
- C++ pass an array by reference
- Why are function pointers and data pointers incompatible in C/C++?
- How many levels of pointers can we have?
- May I take the address of the one-past-the-end element of an array? [duplicate]
- Passing references to pointers in C++
- Can a pointer to base point to an array of derived objects?
- How to get the real and total length of char * (char array)?
- Near and Far pointers
- Check if a pointer points to allocated memory on the heap
- Modifying a char *const string
- Weird Behaviour with const_cast [duplicate]
- Reason why not to have a DELETE macro for C++
- Is the “one-past-the-end” pointer of a non-array type a valid concept in C++?
- What is the difference between std::reference_wrapper and a simple pointer?
- Pointer interconvertibility vs having the same address
- Pointer to array with const qualifier in C & C++
- Is it unspecified behavior to compare pointers to different arrays for equality?
- Are pointer variables just integers with some operators or are they “symbolic”?
- Pointer to array of unspecified size “(*p)[]” illegal in C++ but legal in C
- About Pointers To Functions in function declarations
- How to print member function address in C++
- C++: Why is const_cast evil?
- How to pass a 2d array through pointer in c [duplicate]