Mail Archives: djgpp/2000/11/08/02:03:04
On Tue, 7 Nov 2000, Bill Currie wrote:
> > while ((c = getchar()) != EOF)
> >
> > you could try entering Ctrl-Z and then pressing ENTER on your keyboard.
> > I don't know if this would be the same for all systems, but I think it
> > should work under DOS.
>
> Ctrl-D (normally, it can be changed) in *nix, and no enter: it's immediate (in
> my experience).
On DOS/Windows, you need ENTER, because DOS functions which read from
stdin don't return until you press ENTER. (This can be disabled by
switching the console device into raw mode, but then ^Z is just another
character, it only produces EOF in cooked mode.)
- Raw text -