Re: Objects Not being added to array
Re: Objects Not being added to array
- Subject: Re: Objects Not being added to array
- From: Andrew Farmer <email@hidden>
- Date: Sat, 16 Dec 2006 22:31:20 -0800
On 16 Dec 06, at 21:45, Nick Zitzmann wrote:
int *cur_length = 0;
int *cur_count = 0;
These should not be pointers.
Bingo. Pointer math is your real problem here: cur_length++ causes
cur_length to take on the integer value "4", due to some unusual
rules which C applies to mathematica operations on pointers. Replace
these two variables with plain integers and your problem will be solved.
(If you've got warnings turned on, you should have been getting a
warning about an scalar/pointer mismatch somewhere. Don't ignore
these warnings! They're usually a sign that something's not quite
right in your code.)
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden