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



Felix Kater <f.kater2@xxxxxxx> wrote:
>
> when accessing the variables in a struct: What's the reason why in C
> you have -> and . instead of only . ? Are there cases in which the
> compiler couldn't figure out what to do?

Not anymore. But back in the dark ages, C was much less concerned about
types than it is today and would allow pretty much *anything* as the
left operand of . or ->. In that environment, the compiler couldn't
figure out what to do, so having two different operators was essential.

-Larry Jones

It's no fun to play games with a poor sport. -- Calvin
.



Relevant Pages

  • Re: Free FAT16 Filesystem
    ... being an honourable reason. ... Dave, I made every effort 3 weeks ago to have you understand that if you ... >>Murray did not mention Keil in his correspondence to you. ... >>both your compiler AND under Keil's, ...
    (comp.arch.embedded)
  • Re: "Sorting" assignment
    ... issue on some ancient compiler doesn't make a lot of sense. ... to his on a few commonly used platforms and compilers, ...  Be sure and call the swap ... reason to find algorithms which operate independent of it. ...
    (comp.programming)
  • Re: IMPLICIT NONE (F2k8+/-)
    ... >convention that has served Fortran for 50 years, is itself, no good ... >reason for change. ... >done, using implicit typing. ... The IBM 1130 compiler could do ...
    (comp.lang.fortran)
  • Re: Gentoo - Rumours of proprietary components
    ... or stage2 tarball are not supported anymore." ... The main reason that I can ... Does that include libc and the compiler? ... I want to use an alternative c compiler, and I might use a different C library. ...
    (comp.os.linux.misc)
  • Re: AVR interrupt response time
    ... Maybe with C/IAR or some other compiler. ... critical handler is serviced with minimum delay... ... there is no reason to even push the PSR in this case since the ... I have seen you recommending IAR earlier. ...
    (comp.arch.embedded)