home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / cplus / 18468 < prev    next >
Encoding:
Text File  |  1992-12-28  |  706 b   |  32 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!dynsim1!mbb
  3. From: mbb@litwin.com (Mark Beyleveld)
  4. Subject: testing for null pointer
  5. Message-ID: <1992Dec28.181916.7484@litwin.com>
  6. Organization: Litwin Process Automation
  7. Date: Mon, 28 Dec 1992 18:19:16 GMT
  8. Lines: 22
  9.  
  10. Assuming I declare
  11.  
  12. int* aPointer = 0;
  13.  
  14. is it valid to write
  15.  
  16. if (aPointer) {...}
  17.  
  18. or must I write
  19.  
  20. if (aPointer != 0) {...}
  21.  
  22. Also, are the rules for pointers to member functions the same?
  23.  
  24. ---------------------------------------------------------------------
  25. Mark Beyleveld
  26. Litwin Process Automation
  27. mbb@dynsim1.litwin.com                
  28. -- 
  29. ---------------------------------------------------------------------
  30. Mark Beyleveld
  31. Litwin Process Automation
  32.