int sync();
The protected member function returns zero if the file pointer fp is a null pointer. Otherwise, it returns fflush(fp) to flush any pending output to the stream.
fp
fflush
(fp)