flush c++ code example
Example 1: c++ flush stdin
fflush(stdin);
Example 2: how to use flush in cpp
// Flushing files (flush manipulator)
#include // std::flush
#include // std::ofstream
int main () {
std::ofstream outfile ("test.txt");
for (int n=0; n<100; n++)
outfile << n << std::flush;
outfile.close();
return 0;
}