Hacker News new | ask | show | jobs
by kazinator 837 days ago
> Also, the combined dereferencing and member lookup operator (->).

That's actually a dud. The motivation was likely caused by the silly choice of the dereference operator being unary/prefix, requiring parentheses in (*ptr).memb.

Compare with Pascal's ptr^.member where no parentheses are required.

But ptr.memb can just work as well as value.memb. The operator statically knows whether the left operand is a pointer to a struct/union or a struct/union value.