• 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: ObjC question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ObjC question


  • Subject: Re: ObjC question
  • From: "Hank Heijink (Mailinglists)" <email@hidden>
  • Date: Mon, 21 Feb 2011 15:58:47 -0500

On Feb 21, 2011, at 3:19 PM, Tony Romano wrote:

<snip>

-(void) insert: (BTreeNode **) node node:(BTreeNode *) n
{
…

// get the address of the left member 
[self insert:&[(*node) left] node:n];  // <--- error
}

The compiler(GCC 4.2 or LLVM 1.6) is giving this error : address _expression_ must be an lvalue or a function designator.

The syntax you want is simply this:

BTreeNode *leftNote = [(*node) left];
[self insert:&leftNode node:n];

The return value for [(*node) left] may be an lvalue, but the _expression_ isn't. I don't know of a syntax that will let you get the address you want in one _expression_. However, in the interest of readability, I would prefer the two-line solution regardless.

Best,
Hank
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: ObjC question
      • From: Tony Romano <email@hidden>
References: 
 >ObjC question (From: Tony Romano <email@hidden>)

  • Prev by Date: ObjC question
  • Next by Date: Re: ObjC question
  • Previous by thread: ObjC question
  • Next by thread: Re: ObjC question
  • Index(es):
    • Date
    • Thread