Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #77142

Re: convert unsigned long long into char[4]

From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: convert unsigned long long into char[4]
Date 2015-11-24 18:18 -0800
Organization None to speak of
Message-ID <ln610q2559.fsf@kst-u.example.com> (permalink)
References <n32sd3$qjh$1@dont-email.me> <8h2a5bhisidqqqoejb1cte915mleco6v55@4ax.com> <n3356o$kio$1@dont-email.me>

Show all headers | View raw


bilsch01 <king621@comcast.net> writes:
> On 11/24/2015 05:21 PM, Barry Schwarz wrote:
[...]
>> Why is dc an unsigned long long?  It should fit in an unsigned int on
>> most current systems.
>
> dc is int
> 0x46464645 is not int

If int is (at least) 32 bits, then 0x46464645 is of type int.

If not, then it's of type long.

(It's barely possible that it's of type unsigned int, but that would
require an implementation where int has only 30 value bits.  As far as I
know, no such ipmlementations exist.)

[...]

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

convert unsigned long long into char[4] bilsch01 <king621@comcast.net> - 2015-11-24 15:40 -0800
  Re: convert unsigned long long into char[4] Barry Schwarz <schwarzb@dqel.com> - 2015-11-24 17:21 -0800
    Re: convert unsigned long long into char[4] bilsch01 <king621@comcast.net> - 2015-11-24 18:10 -0800
      Re: convert unsigned long long into char[4] Keith Thompson <kst-u@mib.org> - 2015-11-24 18:18 -0800
  Re: convert unsigned long long into char[4] Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-11-25 00:23 -0800
    Re: convert unsigned long long into char[4] Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-11-25 11:54 +0000
    Re: convert unsigned long long into char[4] bilsch01 <king621@comcast.net> - 2015-11-25 11:35 -0800
  Re: convert unsigned long long into char[4] Jorgen Grahn <grahn+nntp@snipabacken.se> - 2015-11-28 22:06 +0000

csiph-web