[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)



Luc Van der Veken wrote in message <37bc3e1f.819037@news.pandora.be>...
>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.
>
>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)

That is true as far as it goes, but according to Stroustrup "The C++
Programming Language" (which is a pretty authoratative reference), a char
must have at least 8 bits, a short must have at least 16 bits, and a long
must have at least 32 bits.

>- and AFAIR C is generally less restrictive than
>C++.

I don't have a definitive reference for C on hand, but Stroustrup did not
make any changes to the int types when creating C++.


>
>IIRC, this has been discussed here not so long ago.
>