On Oct 24, 2007, at 8:56 PM, Aryeh M. Friedman wrote:

RW wrote:
On Wed, 24 Oct 2007 16:49:24 -0400
"Aryeh M. Friedman" <[EMAIL PROTECTED]> wrote:

I am writing some demo code (for teaching C) ... showing that
int's are always word length


C has been around for a long time and there is always a counter-example
to any sweeping generalisation that isn't backed-up by a standards

BTW I was slightly wrong it is longs not int's that change depending on
word size:

Script started on Wed Oct 24 19:51:44 2007

Just remember this, char <= short <= int <= long. Anything else can be anything. Saying that an int is always four bytes is like saying an int is the same size as a pointer, both of which are assumptions that are often taken but are very wrong. A lot of what decides the sizes of ints is more compiler implementer than anything else. Depending on your system, you'd want your 36 bit ints instead of being limited to only 32.

But if you don't care about portability, then an int is always 32 bits and it's always in little endian order.

freebsd-questions@freebsd.org mailing list
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to