Mail Archives: djgpp-workers/1999/04/20/00:22:03
> > Could people who know their way around C++ in general, and libstdc++ and
> > iostreams in particular, please look at this bug and help me decide
> > whether this has something to do with core DJGPP?
> >
At first I thought it did, but after going through some references I now
don't think so.
>
> After some debugging, I've come up with a sample program that
> illustrates what is going on:
>
> #include <stdio.h>
>
> int main()
> {
> int ch;
> printf("Prompt 1: ");
> ch = getc(stdin);
>
clearerr(stdin);
> printf("\nPrompt 2: ");
> ch = getc(stdin);
> }
>
I think I finally have the correct answer this time.
If you compile the original example, it "fails" just like the sample C++
program in bug #377 when ctrl-z is pressed. When a call to
clearerr(stdin) is added as above, the program waits at the second
prompt. But when I added clearerr(stdin) to bug 377's sample
program, it made no difference. So I have to conclude that it's a
libstdc++ and not a DJGPP problem .
BTW, forget my patch to filbuf since it's not correct.
Mark
---
Mark Elbrecht, snowball3 AT usa DOT net
http://snowball.digitalspace.net/
- Raw text -