Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

7.2. nil Returns Zero

A nil receiver always returns nil or 0 to the caller as long as the caller is expecting the message to return one of the variable types in Table 7-1. The compatible variable types are essentially any pointer or scalar.

Table 7.1. nil Message Return Values
Return TypeReturned Value
idnil
Pointer to any typeNULL
BOOLNO
(unsigned) char'\0'
(unsigned) int0
(unsigned) long int0L
(unsigned) long long int0LL
float0.0f
double0.0
long double0.0



  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial