Re: Pointer to static object member
Re: Pointer to static object member
- Subject: Re: Pointer to static object member
- From: Chris Ridd <email@hidden>
- Date: Thu, 26 Sep 2002 10:29:14 +0100
On 26/9/02 9:00 am, Marcel Weiher <email@hidden> wrote:
>
On Thursday, September 26, 2002, at 03:37 Uhr, John Scalo wrote:
>
>
> Is it possible to get a pointer to a static object member?
>
>
What's a static object member? Do you mean an instance variable?
>
>
Anyway, yes it is possible to get pointers to instance variables, but
>
you don't want to do this.
>
>
> i.e. the equivalent of "&[myFileObj fsRef]".
>
>
No, that won't work, because you can't take the pointer of an
>
expression:
>
>
&(3+4)
>
>
doesn't work.
I think the C standard would say something like the & operator only works on
an lvalue. I'd imagine that a method call, like a C function call, returns
an rvalue. (An lvalue is something that is valid on the left-hand side of an
assignment expression.) I haven't got my ANSI C reference book to hand to
verify all this, sorry.
C++ allows you to do things with function call results that you can't do in
C, so maybe compiling as Objective C++ would help here.
Cheers,
Chris
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.