Flush function clears the file buffer.
Writes all of the characters to the desired file, which is associated with the file variable by calling the
AssignFile procedure. This function guarantees that all of these characters will be written to the file.
Returns 0 if the operation succeeds. If the operation fails, the function returns the error code.