• 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: Trouble with passing variables
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trouble with passing variables


  • Subject: Re: Trouble with passing variables
  • From: Andy Lee <email@hidden>
  • Date: Tue, 28 Feb 2006 15:51:14 -0500

On Feb 28, 2006, at 3:30 PM, Mark Williams wrote:
Ok I am trying something like the following:

-(BOOL)numberAdded:(int*)number
{
	*number++;


Change that to

	(*number)++;

The ++ has higher precedence than the *, so you were incrementing the pointer and then dereferencing it, rather than dereferencing it and incrementing its contents.

--Andy

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Trouble with passing variables
      • From: Jonathon Mah <email@hidden>
References: 
 >Trouble with passing variables (From: Mark Williams <email@hidden>)

  • Prev by Date: Re: Trouble with passing variables
  • Next by Date: line spacing differences between NSTextView and NSAttributedString
  • Previous by thread: Re: Trouble with passing variables
  • Next by thread: Re: Trouble with passing variables
  • Index(es):
    • Date
    • Thread