• 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: Objects Not being added to array
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Objects Not being added to array
      • From: "Matthew Callis" <email@hidden>
References: 
 >Objects Not being added to array (From: "Matthew Callis" <email@hidden>)
 >Re: Objects Not being added to array (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Re: Slider in menu (like System Volume)
  • Next by Date: Re: Objects Not being added to array
  • Previous by thread: Re: Objects Not being added to array
  • Next by thread: Re: Objects Not being added to array
  • Index(es):
    • Date
    • Thread