delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/11/08/02:03:04

Date: Wed, 8 Nov 2000 08:59:59 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Bill Currie <bill AT taniwha DOT org>
cc: djgpp AT delorie DOT com
Subject: Re: EOF
In-Reply-To: <20001107085756.B17227@taniwha.org>
Message-ID: <Pine.SUN.3.91.1001108085732.4601E-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019