• 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: Obj-C difference between NULL and nil
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Obj-C difference between NULL and nil


  • Subject: Re: Obj-C difference between NULL and nil
  • From: Wilfredo Sanchez <email@hidden>
  • Date: Tue, 29 May 2001 11:40:51 -0700

On Saturday, May 26, 2001, at 09:46 AM, Brian Hill wrote:

#define NULL ((void*)0)
#define nil ((id)0)

Conceptually, there is a difference, but only to yourself and other humans that read the code, the compiler doesn't care.

Some compilers are very strict about casting, in which case it would matter. On the assumption that gcc is the only compiler you will ever use, it won't matter, but that's a poor assumption long term.

I've heard that MetroWerks' compiler, for example, is more pedantic than gcc, though I'm not sure if they would be in this case.

-Fred


References: 
 >Re: Obj-C difference between NULL and nil (From: Brian Hill <email@hidden>)

  • Prev by Date: Re: Help doesn't work
  • Next by Date: (Cocoa Newbie) NSTable Issues
  • Previous by thread: Re: Obj-C difference between NULL and nil
  • Next by thread: Fwd: Obj-C difference between NULL and nil
  • Index(es):
    • Date
    • Thread