home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / cplus / 13310 < prev    next >
Encoding:
Text File  |  1992-09-07  |  2.3 KB  |  61 lines

  1. Newsgroups: comp.lang.c++
  2. From: nikki@trmphrst.demon.co.uk (Nikki Locke)
  3. Path: sparky!uunet!pipex!demon!trmphrst.demon.co.uk!nikki
  4. Distribution: world
  5. Subject: Re: Novice Questions
  6. References: <1992Sep3.163337.13948@taumet.com>
  7. X-Mailer: cppnews $Revision: 1.14 $
  8. Organization: Trumphurst Ltd.
  9. Lines: 47
  10. Date: Fri, 4 Sep 1992 19:41:49 +0000
  11. Message-ID: <715660909snx@trmphrst.demon.co.uk>
  12. Sender: usenet@gate.demon.co.uk
  13.  
  14.  
  15. In article <1992Sep3.163337.13948@taumet.com> steve@taumet.com (Steve Clamage) writes:
  16.  
  17. > nikki@trmphrst.demon.co.uk (Nikki Locke) writes:
  18. > >I HATE it when people do that ! (:-)
  19. > >NULL is a POINTER which is guaranteed not to point to any valid location. 
  20. > >It may or may not have the bit pattern all zeroes.
  21. > >'\0' (ASCII NUL) is the CHARACTER which is used to terminate strings.
  22. > >Please do not confuse the novice by using NULL to mean NUL.
  23. > I HATE it when people do that ! (:-)
  24. > Neither C nor C++ is required to use the ASCII character set.
  25. You are quite correct. 
  26.  
  27. I merely assumed you used the word NULL because you had heard someone
  28. pronounce the ASCII name of the '\0' character, and assumed they were
  29. saying NULL.
  30.  
  31. > A literal string in C and C++ will always be terminated by an
  32. > implicit null character, meaning a character having zero value.
  33. > In source code, this may be represented as '\0' (type char).
  34. Nevertheless, NULL has a specific meaning in C(++), and this meaning 
  35. should not include "character '\0'", in my opinion, because it is liable 
  36. to confuse.
  37.  
  38. > This need have nothing to do with ASCII, although the ASCII character
  39. > set happens to have a member of zero value which is called NUL
  40. > when writing about the character set.
  41. Right.
  42.  
  43. I'm not going to get into an argument about this - if you choose to 
  44. overload NULL to mean "character '\0'" as well as "a pointer which is 
  45. guaranteed not to point to a valid address", that's your choice. I just 
  46. don't happen to like it, that's all :-)
  47.  
  48. ---
  49. Nikki Locke              |                        | nikki@trmphrst.demon.co.uk
  50. Trumphurst Ltd.          | Tel: +44 (0)691-670318 | nikki@cix.compulink.co.uk
  51. PC and Unix consultancy  | Fax: +44 (0)691-670316 | nikki@kewill.co.uk
  52. trmphrst.demon.co.uk is NOT affiliated with ANY other sites at demon.co.uk.
  53. Demon.co.uk is a dial-up subscription access point to the Internet.
  54.