>>10So not only is there an assumption of 8-bit bytes, but that unsigned short is at least the size of 2 chars.
No,
sizeof(char)
is always 1. You need at least 16 bits to represent
USHRT_MAX
, and
8 * 2 * 1
happens to be 16.
>>13Yes, because the input and output format should depend on the machine.