Joe Pfeiffer
8/13/2011 5:04:00 AM
Joseph Santoyo <josephsantoyo@gmail.com> writes:
> The part where he says:
>
> "We can't use char since c must be big enough to hold EOF in addition
> to any possible char. Therefore we use int.
>
> Can someone explain this to me?
You pick a char value to mean EOF (let's assume an eight-bit char here,
so you've got 256 to choose from), and I'll give you a file containing
that char as a byte in the file, which your program will misinterpret as
being the end of the file.