Hi All,
Here is a program I wrote and compiled using g++
#include <iostream>
int main() {
char a;
std::cin.get(a) ;
std::cout << a;
std::cin.ignore (100, '\n');
}
The problem is ... I expect that if I type one or more characters when
the program pauses for input on the cin.get, the cin.ignore will find
a '\n' on the input stream and not pause. Unfortunately, it pauses!
Any ideas?
Here is a program I wrote and compiled using g++
#include <iostream>
int main() {
char a;
std::cin.get(a) ;
std::cout << a;
std::cin.ignore (100, '\n');
}
The problem is ... I expect that if I type one or more characters when
the program pauses for input on the cin.get, the cin.ignore will find
a '\n' on the input stream and not pause. Unfortunately, it pauses!
Any ideas?
Comment