home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / c / 18814 < prev    next >
Encoding:
Text File  |  1992-12-23  |  980 b   |  27 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!mcsun!news.funet.fi!hydra!klaava!wirzeniu
  3. From: wirzeniu@klaava.Helsinki.FI (Lars Wirzenius)
  4. Subject: Re: Question to test general C knowledge
  5. Message-ID: <1992Dec23.070530.1128@klaava.Helsinki.FI>
  6. Organization: University of Helsinki
  7. References: <1992Dec21.170917.17770@thunder.mcrcim.mcgill.edu> <wsP8VB1w165w@quest.UUCP>
  8. Date: Wed, 23 Dec 1992 07:05:30 GMT
  9. Lines: 16
  10.  
  11. srhqla!quest!kdq writes:
  12. >mouse@thunder.mcrcim.mcgill.edu (der Mouse) writes:
  13. >> sizeof(4["this is a test"])
  14. >> must produce 1, or your compiler's broken.
  15. >
  16. >    Either that, or you've got 16-bit chars.
  17.  
  18. No.  sizeof measures things in chars, not 8-bit bytes.  sizeof(char)
  19. is guaranteed to be 1.  (I'd quote the standard, but I probably won't
  20. get it until after the next standard has been published and the old
  21. one is sold cheaply. :-)
  22.  
  23. --
  24. Lars.Wirzenius@helsinki.fi  (finger wirzeniu@klaava.helsinki.fi)
  25.    MS-DOS, you can't live with it, you can live without it.
  26.  
  27.