[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: not enough real programmers? (was Re: Byte Magazine: 18 Vintage issues, 1985-1986)



On Thu, 19 Aug 1999 17:42:39 GMT, lucvdv@null.net (Luc Van der Veken)
wrote:

>Chris Brown posted:
>> In article <37bb3ef9.24418394@news.shuswap.net>,
>> Gene Wirchenko <genew@shuswap.net> wrote:
>> >>Not really, just use unsigned longs.
>> >
>> >     I believe it would be a conforming implementation of C to have
>> >short, int, and long all be 16 bits.
>> 
>> Then I believe you believe wrong. :-)
>
>I may be wrong, but I believe you believe he believes wrong
>wrong.

I'm not going to try to top that.  But you are wrong.

>
>In C++, [the size of, for all] a char is smaller than or equal to
>a short, which is smaller than or equal to an int, which is
>smaller than or equal to a long (so a char and a long *can* have
>the same size) - and AFAIR C is generally less restrictive than
>C++.

I don't know about C++, but in C, while char, short, int, long (and
long long in C9x) can all be the same size, minimum range requirements
are placed on all the types.  For example, a char must be capable of
representing (at least) values in the range -127 to +127, and unsigned
char must be able to represent the range 0..255.

More to the point, unsigned long must be able to represent all values
in the range 0..4294967295.  To do that you need at least 32 bits.

Regards,

                          -=Dave
Just my (10-010) cents
I can barely speak for myself, so I certainly can't speak for B-Tree.
Change is inevitable.  Progress is not.