Victor Bazarov
unread,Jun 3, 2012, 9:31:34 AM6/3/12You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
On 6/2/2012 1:22 PM, Paradigm wrote:
> Here is the scenario:
>
> There is a pointer variable 'x'.
>
> For what type of 'x' would the following show a write access on 'x'
>
> std::cout<<*x<<'\n'; //showing write access on x [what's its type?]
>
> I could not think of any possible situation apart from overloaded '*'
> operator having write operation inside the definition itself.
You can't overload the operator* for pointers. That's a built-in one.
Once you dereference *x, you get a reference to the object. The pointer
variable does not have any play in dealing with that, so it seems that
the write access to 'x' itself has nothing to do with '*x'.
V
--
I do not respond to top-posted replies, please don't ask