|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
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
|
|