> I too find it awkward, but in fact, the length of an int is always platform > dependent, we have just gotten (God, I hate that word) used to 16 bit ints > on Intel platforms. Normally an int is the same length as the predominant > register length, which on a PIC, is clearly 8 bits. A 16 bit int is not > part of the C standard. The C standard does not specify the size nor the representation of any numeric types (e.g. a machine that used 5 10-state tubes to store an INT would be perfectly fine) except for the following requirements: [1] A signed char must support values from -127 to 127 [2] A signed int or short must support values from -32767 to 32767 [3] A signed long must support values from -(2^31-1) to (2^31-1) [4] An unsigned char must support values from 0 to 255 [5] An unsigned int or short must support values from 0 to 65535 [6] An unsigned long must support values from 0 to (2^32-1) [7] A char [with default signed-ness] must be capable of storing all of the characters in the standard C character set as positive integers (this latter requirement primarily means that on 8-bit machines which use the EBCDIC character set, characters must be unsigned). [8] sizeof(long) >= sizeof(int) >= sizeof(short) >= sizeof(char) == 1 I think, though I'm not positive, that the following also apply: [A] Any value that can be stored in a signed type must fit in all "larger" signed types. [B] Any value that can be stored in an unsigned type must fit in all "larger" unsigned types. [C] Any non-negative value that fits in a signed type must fit in the corresponding unsigned type. It's perfectly acceptable for machines to have sizeof(int)==1 if a char can hold suitably-large values. For example, on the TI 3205x, ALL inst- ructions to read/write memory use 16-bit values. While it's not terribly difficult to parse out the two halves of a word, the compiler instead just defines "char" to be a 16-bit word--the same size as a short or an int. A bit wasteful of data space, perhaps, but a major saver of time and codespace. Unfortunately, the common PIC compiler's notion that an int is 8 bits and a long is 16 bits fails under tests 2, 3, 5, and 6 above.