On 5/17/20, ron(a)ronnatalie.com <ron(a)ronnatalie.com> wrote:
so here the EOF was different and char was signed 7-bit it seems.
That makes perfect sense if you're dealing with ASCII, which is a 7-bit
character set.
But that assumes you were reading "characters" rather than "bytes."
Binary
data certainly could be any combination of 8 bits and you'd want something
out of band to signal errors/eof.
Well, the function in question is called getchar(). And although
these days "byte" is synonymous with "8 bits", historically it meant
"the number of bits needed to store a single character".
-Paul W.