Mail Archives: djgpp/1997/01/21/06:17:34
From: | Silverio <silverio AT cu DOT lu>
|
Newsgroups: | comp.os.msdos.djgpp,comp.lang.c++
|
Subject: | eof problem (CTRL-Z)
|
Date: | Tue, 21 Jan 1997 10:51:43 +0000
|
Organization: | Centre Universitaire
|
Lines: | 19
|
Message-ID: | <32E49FBE.7289@cu.lu>
|
NNTP-Posting-Host: | rossini.infogest.cu.lu
|
Mime-Version: | 1.0
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Can anybody explain why the following code works with BC5.0 and does not
work with DJGPP gcc version 2.7.2.1 ? The problem is that if the user
enters an EOF (CTRL Z in DOS) to stop the loop, the user is not prompted
to enter the double d !
#include <iostream.h>
int main() {
int i;
while(cin >> i) cout << i << endl; // CTRL Z to stop the loop
cin.clear(); // reset the flags
double d;
cin >> d; // with DJGPP gcc, the user cannot
enter a value
cout << d << endl;
}
Many thanks
Nino Silverio
- Raw text -