lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Xavier Wang wrote:
[...]
> As ISO C Standard specified, the size of char is always 1.

Just to expand (I got very confused by this when working on Clue): the
standard decrees that sizeof() units are all relative to the size of a
char. This means that on some esoteric platforms where chars are bigger
than 8 bits, sizeof(char) will *still* be 1. To figure out how big it
actually is you need CHAR_BIT in <limits.h>.

Plus, sizeof(char) has nothing to do with the machine's address
granularity (which may not be bytes; PICs use 14-bit words each
individually addressable to store their program, for example).

-- 
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│ "I have always wished for my computer to be as easy to use as my
│ telephone; my wish has come true because I can no longer figure out
│ how to use my telephone." --- Bjarne Stroustrup

Attachment: signature.asc
Description: OpenPGP digital signature