In: Computer Science
What method does NOT cause the program to wait until a stream's buffer is empty? (a) flush (b) endl (c) clear (d) close (e) Multiple answers don't pause the program. (f) None of the above cause the program to pause.
I believe that clear is the answer.
flush pauses the program, endl (indirectly calls flush), close (calls flush).
The main problem with buffering is that it can cause delays in the output, but it also reduces the number of CPU cycles required for system calls (read, write). So sometimes to increase the output speed, we flush the buffer in different ways.
All the methods described in the question are explained below:
So the correct answer is clear(), as it technically doesn't clear the data, so it doesn't cause the program to wait until a stream's buffer is empty. Rest of the methods, clear the buffer and causes the program to wait until a stream's buffer is empty.
You are right !!
Please leave a "Thumbs Up", it will be of great help. Thanks.
Happy Studying.