| Paste number 24582: | cout flushes because of cin |
| Pasted by: | Korollary |
| When: | 3 years, 5 months ago |
| Share: | Tweet this! | http://paste.lisp.org/+IYU |
| Channel: | #haskell |
| Paste contents: |
#include <iostream>
#include <sys/select.h>
#include <sys/time.h>
#include <sys/types.h>
using namespace std;
int main(void)
{
cout << "> ";
int i = 0;
cin >> i; // comment this out and it doesn't flush
struct timeval tv;
tv.tv_sec = 5;
select(0, NULL, NULL, NULL, &tv);
cout << i << endl;
return 0;
}
This paste has no annotations.