• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Pointer to static object member
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Pointer to static object member (From: Marcel Weiher <email@hidden>)

  • Prev by Date: Re: Problem killing my threads :)
  • Next by Date: Re: NSUndoManager & NSTableView editing
  • Previous by thread: Re: Pointer to static object member
  • Next by thread: iTunes feature: OT
  • Index(es):
    • Date
    • Thread