Question

In my code fprintf returns successfully by returning the number of bytes written in STREAM, but in the actual file the string I wrote is not there.

Was it helpful?

Solution

The output is probably just buffered. Try closing the file using close() or call fflush() on the stream to force the string to the file.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top