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 ! Is this a bug or not. I can't find an explanation !
#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