Scott Wegener wrote:

> Your compiler is not 'broken'-any decent C book you may be using
> should have mentioned that the size of an int is implementation
> dependent.

Yep.

> DOS/Windoze defines an int as a short int(2 bytes), whereas most
> flavors of Unix define an int as a long int, which is 4 bytes.

Your use of `short int' and `long int' here is misleading. The C types 
with these names don't have any specific size. The only guarantees
are:

a) sizeof(char) <= sizeof(short) <= sizeof(int) <= sizeof(long)

and

b)      a char is at least 8 bits
        a short is at least 16 bits
        an int is at least 16 bits
        a long is at least 32 bits

A long is typically 64 bits on 64 bit architectures. The case of the
Cray, where all types are 64 bits is perfectly valid.

-- 
Glynn Clements <[EMAIL PROTECTED]>

Reply via email to