On 2007-06-09 16:41, bob wrote:
In some code I have the following:
1) (*p) ->value;
2) *p->value;
1) gives an error while 2) works. What are the difference between 1)
and 2)?
1 will first try to dereference p and then call the -on what p points
to, this will only work if what p points to have overloaded that
operator or if p is of type T** (pointer to pointer).
2 on the other hand first uses the -operator on p and then
dereferences value (meaning that value is a pointer). So another way to
write 2 is *(p-value).
--
Erik Wikström