The fflush(FILE* stream) function or the flush() method of the C++ streams forces the unwritten characters in the buffer to be written to the output stream. For example if there are some characters left after writing to the stdout (console) they will be immediately displayed, and the buffer of the output stream associated with the console will be cleared. You might have also faced a situation when you input some data from the console, but the input operations are sometimes skipped. In most cases it means that there is still some data in the stdin buffer left from the previous input operations (probably the newline '\n' character) and it doesn't let you to input another data.
Comments
Leave a comment