home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / c / 19324 < prev    next >
Encoding:
Text File  |  1993-01-06  |  2.0 KB  |  38 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!math.fu-berlin.de!news.th-darmstadt.de!rbg.informatik.th-darmstadt.de!misar
  3. From: misar@rbg.informatik.th-darmstadt.de (Walter Misar)
  4. Subject: Re: Exact-sized types (was Re: Typedefing builtin... thanks.)
  5. Sender: news@news.th-darmstadt.de (The News System)
  6. Message-ID: <1993Jan6.202221@rbg.informatik.th-darmstadt.de>
  7. Date: Wed, 6 Jan 1993 19:22:21 GMT
  8. References: <1992Nov30.204147.7955@cimage.com> <84931@ut-emx.uucp> <F9I0BER@math.fu-berlin.de>
  9. Nntp-Posting-Host: rbhp58.rbg.informatik.th-darmstadt.de
  10. Organization: TH Darmstadt
  11. Lines: 25
  12.  
  13. In article <F9I0BER@math.fu-berlin.de>, rene@hamel.uucp (Rene Mueller) writes:
  14. > In article <84931@ut-emx.uucp>, jamshid@ut-emx.uucp (Jamshid Afshar) writes: 
  15. > |> I don't understand the purpose of the "at-least-N-bits" types.  C
  16. > |> already has those -- char (>=8), short (>=16), int (>=16), and long
  17. > |> (>=32).  What does your extra level of indirection buy you?
  18. > You are'nt correct:
  19. > int is as long as a single machine word on the machine (on some machines this
  20. > means 12bit), on this machines also a short is 12bit long and a long is 24bits
  21. > long...
  22. > The same is with characters
  23. > Some compilers will give you only the original ASCII-Characterset and a 
  24. > char-value with this machines is 7bit long, all other bits stored in memory
  25. > for this value will be ignored...
  26.  
  27. Nope, he is correct. I don't know exactly about chars, but ints and shorts
  28. have to have at least 16 bit (on a binary machine this is, the definition
  29. was, that both must be able to hold all numbers n with -32768<n< +32768).
  30. Similar with longs: they have to be at least 32 bits. Int should have a
  31. size of a 'natural word' on a given machine, but if this proves to be to small,
  32. an int has to be constructed out of several words.
  33.  
  34. -- 
  35. Walter Misar                                | It is impossible to enjoy
  36. misar@rbg.informatik.th-darmstadt.de        | idling thoroughly unless
  37.                                             | one has plenty of work to do.
  38.