Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Obj-C difference between NULL and nil



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>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.