why p->member ?

Karl Heuer karl at haddock.ISC.COM
Thu Aug 11 07:36:38 AEST 1988


In article <12937 at mimsy.UUCP> chris at mimsy.UUCP (Chris Torek) writes:
>to restate the question, `why does not p.member follow the pointer
>automagically?'  [Historical reason deleted]

People have enough trouble with the difference between pointers and arrays.
If `.' and `->' were the same operator, they'd have a similar difficulty
understanding the difference between structs and struct pointers.

Also, even those of us who understand the difference are likely to make a typo
now and then.  I prefer my typos to elicit an error message from the compiler,
rather than silently guessing what I meant.

Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint



More information about the Comp.lang.c mailing list