Re: The "->" operator

From: Ben Pfaff (blp_at_cs.stanford.edu)
Date: 12/12/03


Date: 11 Dec 2003 21:37:10 -0800

Jeff Rodriguez <newsgroup1@gurugeek.EXAMPLENOSPAM.com> writes:

> What does this do? I've been looking online and I've seen mention that
> it exists as well as examples to it's use but still no explination as
> to exactly what it does.

The -> operator dereferences its left operand, then accesses one
of the members of the referenced object (which must be of
structure or union type). a->b is equivalent to (*a).b. The ->
operator is simply there to reduce the need for parentheses in
accessing a structure member through a pointer.

-- 
Here's a tip: null pointers don't have to be *dull* pointers!