Re: Trouble with passing variables
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