Take the 2-minute tour ×  In C, the fread function is like this:
size_t fread(void *buf, size_t max, FILE *file);  Usually char*
arrays are used as buf. People usually assume that char = 8 bit.
But what if it isn't true? What happens if files written in 8
bit byte systems are read on 10 bit byte systems? Is there any
single standard on portability of files and network streams
between systems with bytes of different size? And most
importantly, how to write portable code in this regard?
share|improve this question Probably 8-bit bytes are just
widened up to 10 bits adding zeroes as MSbits, since it's in the
best interest of those "strange" systems to be compatible with
the rest of the world that uses 8-bit bytes. Also, AFAIK all
these systems are "strange" systems (DSPs, old mainframes, ...)
that do not usually deal with "regular" files produced by
"regular" machines. –  Matteo Italia Dec 22 '12 at 16:33 Use the
new suggested typedefs for int types: uint8_t –  stdcall Dec 22
'12 at 16:39 I just received an an