John Gordon <> writes:
> In <ioknmm$v3v$> Martin Ambuhl <> writes:
>
>> No, you can't. This presumes
>> 1) a particular size for char
>
> Isn't sizeof(char) guaranteed to be 1?
Yes.
But the code in question appeared to assume that an int is 2 bytes.
I suppose one could say either than (a) it assumes int is 2 bytes,
or (b) it assumes char is 8 bits and int is 16 bits.
(Incidentally, int is 32 bits, or 4 8-bit bytes, in win32, which is the
OP's environment.)
Determining exactly which questionable assumptions the code made is
probably less useful than actually fixing it.
--
Keith Thompson (The_Other_Keith)
kst- <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"