Re: What's the difference between (*(x)).a and (x)->a

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/21/09, John Fine <johnsfine@xxxxxxxxxxx> wrote:
> Lawrence Crowl wrote:
> > > holderlin wrote:
> > > > Is there any difference between (*(x)).a and (x)->a, if x is an
> > > > expression which generates a struct pointer.
> >
> > They are the same for the C language, but may be different in C++
> > if the struct has overloaded the * or -> operators.
>
> Can they be different in C++ ?
>
> A key phrase in the question is "x is an expression which generates
> a struct pointer."
>
> You can overload the meaning of * or -> if x is a struct.  I thought
> you couldn't overload them if x is a pointer.

Yes, you're right.  I somehow glossed over the constraint.

-- 
Lawrence Crowl

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux