bhupixb

Fflush std out

Apr 23rd, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. #include <iostream>
  2. #include <thread>
  3. #include <chrono>
  4. using namespace std;
  5. int main()
  6. {
  7. for(int i = 1; i < 11; ++i)
  8. {
  9. this_thread::sleep_for(i*50ms);
  10. cout<<i<<" " << flush; // This line
  11. }
  12. return 0;
  13. }
Add Comment
Please, Sign In to add comment