Re: why use -> (not .) with pointers?
- From: "Suman" <skarpio@xxxxxxxxx>
- Date: 30 Jun 2005 06:16:10 -0700
Felix Kater wrote:
> Hi,
>
> 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?
-> is used when you have a pointer to a struct, and you are trying to
access
elements of the struct whose address is stored in the pointer.
.. is used when you have an object of a struct, and you are trying to
access
elements of the struct.
Does that help?
.
- Follow-Ups:
- Re: why use -> (not .) with pointers?
- From: Richard Tobin
- Re: why use -> (not .) with pointers?
- From: jacob navia
- Re: why use -> (not .) with pointers?
- References:
- why use -> (not .) with pointers?
- From: Felix Kater
- why use -> (not .) with pointers?
- Prev by Date: why use -> (not .) with pointers?
- Next by Date: Re: why use -> (not .) with pointers?
- Previous by thread: why use -> (not .) with pointers?
- Next by thread: Re: why use -> (not .) with pointers?
- Index(es):
Relevant Pages
|