Re: C question (was: Tcl-C question)
From: Benjamin Riefenstahl (Benjamin.Riefenstahl_at_epost.de)
Date: 10/06/03
- Next message: lvirden_at_yahoo.com: "Re: Linux vs WinXP performance"
- Previous message: David N. Welton: "Re: grab html table[s] from html to files"
- In reply to: Sabyasachi Basu: "Re: Tcl-C question"
- Next in thread: Sabyasachi Basu: "Re: C question (was: Tcl-C question)"
- Reply: Sabyasachi Basu: "Re: C question (was: Tcl-C question)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 06 Oct 2003 15:12:30 +0200
Hi Sabyasachi,
"Sabyasachi Basu" <sabya_01@hotmail.com> writes:
> There aren't any minimum specified sizes for these types in C. The
> only constraint is that the types satisfy the following condition:
>
> sizeof(short) <= sizeof(int) <= sizeof(long)
Ok, what the heck, I checked out my old reference. ISO/IEC 9899:1990
(aka C89 or C90), 5.2.4.2.1 "Sizes of integral types <limits.h>" has
this to say:
Their implementation-defined values shall be equal or greater in
magnitude (absolute value) to those shown, [...]
[...]
UCHAR_MAX 255
[...]
USHRT_MAX 65535
[...]
UINT_MAX 65535
[...]
ULONG_MAX 4294967295
These define the minimum range for unsigned numbers. There are also
similar ranges defined for signed numbers of course.
When I am interested in bitsizes, I am usually also doing some
bitshifting with the numbers and that is ill-defined for signed
numbers, so I am only interested in the unsigned variety.
>"Darren New" <dnew@san.rr.com> wrote in message
>> Unless you count K&R as "a standard", yeah.
I learned C back before the ANSI C standard was ratified, but the very
first compilers that I used already had all the features that the
standard provided. That was more than 13 years ago, i.e. "ages" in
the realm of software development.
Today there may be some weird systems that don't have a complete (or
correct) standard C library, but even on those a C compiler that has
all the basic language features should be available.
benny
- Next message: lvirden_at_yahoo.com: "Re: Linux vs WinXP performance"
- Previous message: David N. Welton: "Re: grab html table[s] from html to files"
- In reply to: Sabyasachi Basu: "Re: Tcl-C question"
- Next in thread: Sabyasachi Basu: "Re: C question (was: Tcl-C question)"
- Reply: Sabyasachi Basu: "Re: C question (was: Tcl-C question)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]