Re: bytes calculation



On 30 Jul, 15:55, jacob navia <ja...@xxxxxxxxxxxxxxxx> wrote:
Spoon wrote:
Pietro Cerutti wrote:

Assuming that sizeof(unsigned long long) == 64 and sizeof(int) == 32

I think you meant "Assuming CHAR_BIT == 8, sizeof(int) == 4, and
sizeof(unsigned long long) == 8".

Please, are you a lawyer?

you say that like it's a bad thing...

Note: sizeof returns the number of chars in an object (or type)
*not* the number of bits.


Can you tell me of a machine where char_bit != 8 ?

And please, a machine in use 2007 ok?

But like you I'm puzzled as to why a 32-bit shift
on a 64-bit quantity doesn't yield the top 32-bits.
Unless I misunderstood something...



--
Nick Keighley


.



Relevant Pages

  • Same text at the beginning of line. Simple Shell-Script?
    ... chars) at the beginning of each paragraph or Sentence in a Document? ... LAWYER: Before you signed the death certificate, ...
    (comp.os.linux.misc)
  • Re: read and write
    ... Is there a way to pass something like sizeof to that last write ... parameter to not have to put an exact number of bytes in it? ... This an actual array of chars, not a pointer to an array of ... chars located elsewhere. ...
    (comp.unix.programmer)
  • Re: array questions
    ... >>> an object of 10 chars. ... >>> Why is this anomalous behaviour? ... > A lot of people forget that sizeof is not a function call, ... Prev by Date: ...
    (comp.lang.c)
  • Re: Template specialization to get just-wide-enough integer
    ... But then I have to specify my size in bytes (chars) rather than bits, ... Because you're using sizeof. ...
    (microsoft.public.vc.language)
  • Re: malloc
    ... sizeof is only slightly better. ... If you, say, switch to ... wide chars other changes are also needed ... Prev by Date: ...
    (comp.lang.c)