home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / c / 19042 < prev    next >
Encoding:
Internet Message Format  |  1992-12-30  |  1.9 KB

  1. Path: sparky!uunet!paladin.american.edu!gatech!swrinde!zaphod.mps.ohio-state.edu!rpi!crdgw1!rdsunx.crd.ge.com!bart!volpe
  2. From: volpe@bart.NoSubdomain.NoDomain (Christopher R Volpe)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Question to test general C knowledge
  5. Message-ID: <1992Dec30.205155.19105@crd.ge.com>
  6. Date: 30 Dec 92 20:51:55 GMT
  7. References: <1992Dec28.161730.13653@mksol.dseg.ti.com> <m5TiwB1w165w@quest.UUCP>
  8. Sender: volpe@bart (Christopher R Volpe)
  9. Reply-To: volpe@ausable.crd.ge.com
  10. Organization: GE Corporate Research & Development
  11. Lines: 37
  12. Nntp-Posting-Host: bart.crd.ge.com
  13.  
  14. In article <m5TiwB1w165w@quest.UUCP>, kdq@quest.UUCP (Kevin D. Quitt) writes:
  15. |> mccall@mksol.dseg.ti.com (fred j mccall 575-3539) writes:
  16. |> >In <wsP8VB1w165w@quest.UUCP>kdq@quest.UUCP (Kevin D. Quitt) writes:
  17. |> >>mouse@thunder.mcrcim.mcgill.edu (der Mouse) writes:
  18. |> >>>sizeof(4["this is a test"])
  19. |> >>>must produce 1, or your compiler's broken.
  20. |> >>
  21. |> >>   Either that, or you've got 16-bit chars.
  22. |> >
  23. |> >sizeof(char) is defined to be 1, so it doesn't matter if you have
  24. |> >16-bit chars or not; it still better give back a 1.
  25. |> 
  26. |>     Interesting.  The standard states (3.3.3.4) that sizeof returns the
  27. |> size of an object in bytes (exclusive of function and incomplete
  28.  
  29. "Bytes" in this context are identical to "chars". Bytes contain an
  30. implementation defined number of bits according to the definition
  31. of terms. The standard certainly supports the 16bit character. Its "size"
  32. according to "sizeof", however, is still 1. Such an implementation has
  33. 16bit bytes.
  34.  
  35. |> types), and also states that the sizeof any qualified char is 1.
  36. |> 
  37. |>     Apparently, while they support multi-byte characters, as strings
  38. |> (and provide functions for them), they don't directly support the 16bit
  39. |> character.  Hmm...
  40. |> 
  41. |> 
  42. |> 
  43. |>  _
  44. |> Kevin D. Quitt      96.37% of all statistics are made up.     srhqla!quest!kdq
  45.  
  46. -- 
  47. ==================
  48. Chris Volpe
  49. G.E. Corporate R&D
  50. volpecr@crd.ge.com
  51.