Re: pointer to structure member reference?
Re: pointer to structure member reference?
- Subject: Re: pointer to structure member reference?
- From: Chunk 1978 <email@hidden>
- Date: Mon, 2 Nov 2009 20:15:50 -0500
ah, ok... i get it now. thanks for the responses.
On Mon, Nov 2, 2009 at 8:13 PM, Graham Cox <email@hidden> wrote:
>
> On 03/11/2009, at 11:58 AM, Chunk 1978 wrote:
>
> having a bit of a time understanding this: ->
>>
>> i think it's used to point to a member of a supplied argument of the
>> method?
>>
>> - (void)method:(NSRange *)aRange ofSize:(NSSize *)aSize
>> {
>> aRange->location = 0;
>> aSize->height = 4.0;
>> }
>>
>
> -> is just a pointer. It even looks like one!
>
>
>
>
>> is it not possible to use dot notation here?
>>
>
> Yes, but since here the range is passed as pointer-to-range, you need to
> dereference:
>
> *aRange.location = 0;
>
> aRange->location = 0 is clearer, IMO.
>
> --Graham
>
>
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden