>I was just wondering if you've seen examples where a CHAR_BIT wasn't 8.
Analog SHARC - CHAR_BIT == 32
DSP 56156 Motorola - CHAR_BIT = 32
DSP Texas - CHAR_BIT = 16
Just a few.
-Prelude
Printable View
>I was just wondering if you've seen examples where a CHAR_BIT wasn't 8.
Analog SHARC - CHAR_BIT == 32
DSP 56156 Motorola - CHAR_BIT = 32
DSP Texas - CHAR_BIT = 16
Just a few.
-Prelude
Cool. I'll keep that in mind.
So Dave and Prelude,
Are you saying that on a machine where CHAR_BIT is 16:
If an int is 16 bits, sizeof(int) returns 1?
If an int is 32 bits, sizeof(int) returns 2?
yes. sizeof() returns size in chars, however big a char may be.Quote:
Originally posted by swoopy
So Dave and Prelude,
Are you saying that on a machine where CHAR_BIT is 16:
If an int is 16 bits, sizeof(int) returns 1?
If an int is 32 bits, sizeof(int) returns 2?
And what you wanna bet each memory location on such a machine is also 16 bits wide.Quote:
Originally posted by moi
yes. sizeof() returns size in chars, however big a char may be.