Fprintf returns success but cannot write existing file

In my code, fprintf successfully returns, returning the number of bytes written in STREAM, but in the actual file, the line I wrote does not exist.

+3
source share
1 answer

The output is probably just buffered. Try closing the file using the close () function, or call fflush () on the stream to force a line into the file.

+5
source

Source: https://habr.com/ru/post/1696695/


All Articles