Which function in C is used to flush the output buffer of a stream?
- clear()
- fflush()
- flush()
- flushout()
The correct function is fflush(). It is used to flush the output buffer of a stream, ensuring that any buffered data is written to the file or output device. This is particularly useful when you want to ensure that data is immediately written without waiting for the buffer to fill up.
Loading...
Related Quiz
- Why is it recommended to use pointer arithmetic instead of array indexing for traversal in some cases?
- A two-dimensional array can be visualized as a ________.
- You're debugging a segmentation fault in a program and find that a pointer is being accessed after it has been freed. What is this type of pointer error called?
- Using the ________ function, the file pointer can be moved to the end of a file.
- In what scenario would using a nested structure be beneficial?