For example, here's a reference for fread:
size_t fread ( void * ptr, size_t size, size_t count, FILE * stream );
Reads an array of count elements, each one with a size of "size bytes"...
So how many BITS will read an fread(&x, 1, 1, stream)
? Eight or CHAR_BIT
?
fread
function reads, into the array pointed to byptr
, up tonmemb
elements whose size is specified bysize
, from the stream pointed to bystream
." – VagrancyCHAR_BIT
is guaranteed (by Posix) to be equal to 8. – TillettCHAR_BIT
value, it's good to be aware of the semantics here. – Millarfread
on it, because it's probably some DSP with a freestanding C implementation and no byte-based standard I/O. – Tillett