Brian Epstein on Fri, 18 Jan 2002 17:40:23 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] EOF


EOF is defined in stdio.h

/* End of file character.
   Some things throughout the library rely on this being -1.  */
#ifndef EOF
# define EOF (-1)
#endif

ep

On Fri, 18 Jan 2002 paul@dpagin.net wrote:

> Thanks.  I'll pass that on.
>
> I figured EOF is defined somewhere, but I wouldn't know where since I
> haven't done C programming in a while.  Anyway, I'm sure the information
> will be very useful.
>
>
> > On Fri, Jan 18, 2002 at 08:28:02AM -0500, paul@dpagin.net wrote:
> > > I'm using Linux to program C, however, when I try to do something like (
> > > c = getchar() ) != EOF
> >
> > Have you tried using '^V^D' there instead of literally typing out
> > EOF? (That's control-V control-D. ^V makes the subsequent control
> > character visible.)
> >
> > EOF is #defined in a system include somewhere which you're probably
> > not including in your source. Figuring out which include file would
> > also do the trick. (I never have because any time I've wanted to
> > check for the existence of EOF, I've also wanted to do more
> > complicated input processing and I've just linked against the GNU
> > readline library so I didn't have to think about it.)
> >
> > > I can't input the EOF character ( which is "Ctrl + Z" under DOS ), I
> > > found in webs that "Ctrl + D" can do the job, but it doesn't work
> for me.
> >
> > ^Z for EOF? That's totally crazy. ^D is the Unix (and POSIX, and
> > ISO, and...) standard key sequence to enter EOF. But it may or may
> > not work under Windows. (Gee, there's a shocker. ;^>)
> >
> > Fwiw, I'm pretty sure ^D dtrt under Mac OS, even before Mac OS X, as
> > long as you're not using an application that chooses to catch and
> > interpret it itself. But I haven't checked lately.
>
>
> ______________________________________________________________________
> Philadelphia Linux Users Group       -      http://www.phillylinux.org
> Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce
> General Discussion  -  http://lists.phillylinux.org/mail/listinfo/plug
>

-- 
Brian Epstein <ep@epiary.org>
Key fingerprint = F9C8 A715 933E 6A64 C220  482B 02CF B6C8 DB7F 41B4


______________________________________________________________________
Philadelphia Linux Users Group       -      http://www.phillylinux.org
Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce
General Discussion  -  http://lists.phillylinux.org/mail/listinfo/plug