how is size of unsigned int defined?

Graham Bromley graham at orca.UUCP
Fri Dec 21 03:41:30 AEST 1984


> Does anyone know if unsigned int is defined to be the same size as
> long int, or int?  I couldn't find this in Kernighan and Ritchie.

    An unsigned int is what it says: an unsigned int. There is also
an unsigned short and unsigned long (or unsigned short int and
unsigned long int if you like). Some implementations also have
an unsigned char for byte sized unsigned integers.
    An unsigned int may actually be the same size as an unsigned long
(e.g. on a VAX, both 32 bits) or as an unsigned short (e.g. on a 
PDP11, both 16 bits). But an unsigned object is always by definition
the same size as its signed counterpart.

    gbgb aka the longjmp artist



More information about the Comp.lang.c mailing list