Mail Archives: djgpp/2000/01/24/11:01:31
Damian Yerrick <MYNAMEISd_yerrick AT hotmail DOT comno2cannedham> wrote:
> On Sat, 22 Jan 2000 13:29:52 -0600, David Cleaver <davidis AT ou DOT edu>
> wrote:
>>However, if the char type ever increases in size, my tables
>>wouldn't be as tighly packed as possible, so I wanted to
>>know if it was ever going to change.
> The .txt file format specification depends on a one-byte 'char' type;
> I don't see it changing soon.
What '.txt file format specification' would that be? On what machine?
Technically speaking, C doesn't care a bit about how 'text' is
represented in files, outside the program. It's the duty of the
stdio.h functions to translate whatever there is, out there, into the
C type of 'a long stream of 'char' values'.
And yes, there *are* C compilers out there for which a char is not 8
bits. Mostly for 'exotic' hardware, like Digital Signal Processors
(DSPs) that don't have any support for units of data smaller than
32bits, but that doesn't mean they're not perfectly valid ANSI C
compilers.
For short: char, like all the C data types, is implementation defined.
You should never assume it's 8 bits, if you can help it, as that
renders your program unportable.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -