Re: EOF question
From: Kenneth Brody (kenbrody+clc_at_spamcop.net)
Date: 08/11/04
- Next message: Kenneth Brody: "Re: file size error - urgent"
- Previous message: RJJ: "Two Questions"
- In reply to: newby2c: "Re: EOF question"
- Next in thread: CBFalconer: "Re: EOF question"
- Reply: CBFalconer: "Re: EOF question"
- Reply: newby2c: "Re: EOF question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 11 Aug 2004 12:39:06 -0400
newby2c wrote:
>
> "CBFalconer" <cbfalconer@yahoo.com> wrote in message
> news:4118F86E.5F479632@yahoo.com...
> > No, line, enter, ctl-z, enter.
>
> Thanks again.
> Ran prog. Typed line. Hit <enter> (the caret moved to new line).
> Hit <ctrl-z>. Prog. terminates.
> Never had a chance to hit <enter>.
> This was the program in it's original form (without getchar();).
> With the getchar(); in place just before the return 0; I type some words,
> hit <enter>, then hit <ctrl-z>, (prog. does *not* terminate), lastly I hit
> <enter>. The prog. terminates, but there is still no output.
>
> newby2c
>
> newby2c
It could be a bug in Windows and/or the C runtime.
Change the printf() line to read:
printf("aefore newline\nafter newline %ld\n",nc);
On Windows 98, with MSVC 6.0a (compiler version 12.00.8168) typing
"foobar" newline Ctrl-Z newline, I get:
foobar
after newline 7
Note that everything in the printf() prior to the newline is gone.
On Windows XP:
foobar
^Z
before newline
after newline 7
And the program has not yet exited. I need to press Enter one more time
to get the program to exit.
-- +-------------------------+--------------------+-----------------------------+ | Kenneth J. Brody | www.hvcomputer.com | | | kenbrody/at\spamcop.net | www.fptech.com | #include <std_disclaimer.h> | +-------------------------+--------------------+-----------------------------+
- Next message: Kenneth Brody: "Re: file size error - urgent"
- Previous message: RJJ: "Two Questions"
- In reply to: newby2c: "Re: EOF question"
- Next in thread: CBFalconer: "Re: EOF question"
- Reply: CBFalconer: "Re: EOF question"
- Reply: newby2c: "Re: EOF question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|