home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / cplus / 20084 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  1.1 KB

  1. Path: sparky!uunet!crdgw1!rpi!uwm.edu!spool.mu.edu!agate!doc.ic.ac.uk!pipex!demon!trmphrst.demon.co.uk!nikki
  2. From: nikki@trmphrst.demon.co.uk (Nikki Locke)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Is (p) instead of (p!=NULL) portable?
  5. Message-ID: <728160328snx@trmphrst.demon.co.uk>
  6. Date: 27 Jan 93 11:45:28 GMT
  7. References: <1993Jan25.125627.29030@ugle.unit.no>
  8. Sender: usenet@demon.co.uk
  9. Reply-To: nikki@trmphrst.demon.co.uk
  10. Organization: Trumphurst Ltd.
  11. Lines: 16
  12. X-Mailer: cppnews $Revision: 1.31 $
  13.  
  14. In article <1993Jan25.125627.29030@ugle.unit.no> robert@alkymi.unit.no (Robert Schmidt) writes:
  15. > In PC C's, the NULL pointer is defined with a bit pattern of all zero's,
  16. > and the constructs 
  17. >       if (p)
  18. > and
  19. >       if (!p)
  20. > checks for NULL and non-NULL respectively.  Is this portable to *all*
  21. > platforms?
  22.  
  23. Yes. Even if a NULL pointer does NOT have a bit pattern of all zeroes, the
  24. above is still guaranteed to work.
  25.  
  26. -- 
  27. Nikki Locke,Trumphurst Ltd.(PC and Unix consultancy) nikki@trmphrst.demon.co.uk
  28. trmphrst.demon.co.uk is NOT affiliated with ANY other sites at demon.co.uk.
  29.