• 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: Can I assume uninitialized variable's value to be nil or 0?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can I assume uninitialized variable's value to be nil or 0?


  • Subject: Re: Can I assume uninitialized variable's value to be nil or 0?
  • From: Ryan Britton <email@hidden>
  • Date: Wed, 17 May 2006 20:12:48 -0700

You cannot assume this. It will usually happen because you're accessing clean memory, but it's entirely possible that you'll end up with a value referenced to some previously-used memory. This is particularly true when using local variables since they're stored on the stack.


On May 17, 2006, at 8:04 PM, Eric wrote:

Can I assume declared but uninitialized variable to have the value of nil
(for pointer type) or 0 (for numeric type)? Coming from Java, I was used to
make those assumptions. I'm wondering whether it's the same for Objective-C
/ C.


Thanks,
Eric
_______________________________________________
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

_______________________________________________ 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
References: 
 >Can I assume uninitialized variable's value to be nil or 0? (From: Eric <email@hidden>)

  • Prev by Date: Re: What's so special about NSString literals? (RE: memory management)
  • Next by Date: Re: What's so special about NSString literals? (RE: memory management)
  • Previous by thread: Re: Can I assume uninitialized variable's value to be nil or 0?
  • Next by thread: Re: Can I assume uninitialized variable's value to be nil or 0?
  • Index(es):
    • Date
    • Thread