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



On 30 Jun 2005 16:36:32 GMT, richard@xxxxxxxxxxxxxxx (Richard Tobin)
wrote:

>In article <42c41b0e$0$309$7a628cd7@xxxxxxxxxxxxxxxxxxxxx>,
>Guillaume <"grsNOSPAM at NOTTHATmail dot com"> wrote:
>
>>To me, it's still essential syntactically speaking.
>>
>>Letting the compiler "guess" what you mean is a really, really bad idea
>>in general. Even when the case seems obvious to you.
>
>So would you favour having different operators for integer and
>floating-point addition?

Actually, in light of a problem I tracked down yesterday, that might
not be a bad idea :-)

The end result was truncating fractional hours on a time report. Of
course, that wasn't all - the programmer had cast the result to a
float, then done an sprintf with %f. It got a segmentation violation
only sometimes.

> Is it a disaster that if foo is a function
>pointer you can say foo(1) instead of (*foo)(1)?
>
>Why is determining the action "guessing" in this case but not the
>others?
>
>-- Richard

--
Al Balmer
Balmer Consulting
removebalmerconsultingthis@xxxxxxx
.



Relevant Pages

  • Re: OT Computer virus question
    ... Steve Gibson is one hell of a programmer. ... >The next test is "common ports". ... Balmer Consulting ...
    (rec.outdoors.rv-travel)
  • Re: Protecting your code
    ... question was based on false premises. ... programmer, for starters. ... a correct answer to your original question would ... Balmer Consulting ...
    (comp.programming)
  • Re: Protecting your code
    ... *programmer* who holds the copyright, not the person who hired him. ... This type of programming should be done only under a written contract. ... >an appropriate legal contract in advance, in a country where it will be ... Balmer Consulting ...
    (comp.programming)