Re: why use -> (not .) with pointers?



On Thu, 30 Jun 2005 07:14:37 -0700, Suman wrote:

>
>
> Richard Tobin wrote:
> [snip]
>>
>> I think the answer is just that they are different operations so C has
>> different names for them. a->b is equivalent to (*a).b.
> Don't you think that was what I meant, albeit in a roundabout way?
> You don't I'll assume for now :)
>
> <i_think_remotely_O(n)T(opic)>
> In any case, this fires my curiosity. What if we did have the _same_
> operator? Would the compiler not have to do extra work?

Not to any measurable degree. It has to validate the type of the left hand
operand either way.

Lawrence
.



Relevant Pages

  • Re: Question about the *= (and similar) operator
    ... Richard Tobin wrote: ... E2 would be the right operand of the *= operator. ... additive expression must be an additive expression, ... But C operators are not like macros. ...
    (comp.lang.c)
  • Re: Me and David C. Ullrich
    ... Richard Tobin wrote: ... >>at least one is a head. ... We know that the writer of the statement observed Hx, ... Prev by Date: ...
    (sci.math)
  • Re: why use -> (not .) with pointers?
    ... Richard Tobin wrote: ... > explicit language than C might confound these, ... Prev by Date: ...
    (comp.lang.c)
  • Re: why use -> (not .) with pointers?
    ... Richard Tobin wrote: ... > explicit language than C might confound these, ... Prev by Date: ...
    (comp.lang.c)
  • Re: abundance of irrationals!)
    ... > richard@xxxxxxxxxxxxxxx (Richard Tobin) wrote in message ... For all n, the sum is finite, because all for all n, n is finite. ... since it has no legitimate mathematical meaning otherwise. ... Prev by Date: ...
    (sci.math)