How to flush and why to use it ?
In C++ you may use fflush(stdout) or cout << flush (it depends on what do you use for output data — scanf/printf or cout).
Also, using cout<<endl in C++ performs flush operation automatically.
How to flush and why to use it ?
In C++ you may use fflush(stdout) or cout << flush (it depends on what do you use for output data — scanf/printf or cout).
Also, using cout<<endl in C++ performs flush operation automatically.