[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)
I get the feeling that an awful lot of people who consider themselves
'real' programmers reckon that 'real' C == K&R C.
K&R is undoubtedly a classic, but it's 21 years old and ought to have
some kind of a party to celebrate!
On Thu, 19 Aug 1999 18:39:18 GMT, in
<qbYu3.1309$pC1.95872@cac1.rdr.news.psi.ca> Spehro Pefhany
<speff@interlog.com> wrote:
>In comp.arch.embedded Luc Van der Veken <lucvdv@null.net> wrote:
>> 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) - and AFAIR C is generally less restrictive than
>> C++.
>
>K & R says: "The intent is that 'short' and 'long' should provide
>different lengths of integers where practical; 'int' will normally reflect
>the most "natural" size for a particular machine. (...) each compiler is
>free to interpret 'short' and 'long' as appropriate for its own hardware.
>About all you should count on is that 'short' is no longer than 'long'.
>
>The C++ draft standard says:
>
>There are four signed integer types: �signed char�, �short int�, �int�,
>and �long int.� In this list, each type provides at least as much storage
>as those preceding it in the list. Plain ints have the natural
>size suggested by the architecture of the execution environment* ; the
>other signed integer types are provided to meet special needs.
>
>*that is, large enough to contain any value in the range of INT_MIN and
>INT_MAX, as defined in the header <climits>.
--
Steve Rencontre, Design Consultant
http://www.rsn-tech.demon.co.uk/ -- remember to despam return address