• 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: Mark Williams <email@hidden>
  • Date: Thu, 2 Mar 2006 08:28:22 -0700

I want to thank every one for the help. I did as everyone instructed and changed the increment to (*number)++. I never would have thought of it since my C book showed that *number++ was correct.
Anyway the program now works. Thank you very much


Mark.

On Feb 28, 2006, at 6:46 PM, Jonathon Mah wrote:

Hi Mark,

On 2006-03-01, at 07:21, Andy Lee wrote:

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.

Just to clarify: Since you used the post-increment, you were incrementing the pointer and then dereferencing its _old_ (un- incremented) value.




Jonathon Mah
email@hidden





_______________________________________________ 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
  • Prev by Date: Re: Punching a hole in an NSImage
  • Next by Date: Re: Need HELP - Dragging a view
  • Previous by thread: Re: Punching a hole in an NSImage
  • Next by thread: Cannot create a foundation tool
  • Index(es):
    • Date
    • Thread