I am using fputs to write strings to file, but under the debug mode, the content is not written to disk after the statement fputs. I think there is some buffer. But I would like to debug to check whether the logic is correct by viewing the content directly. Is there anyway to disable the buffer? Thanks.
Share
You have a couple of alternatives:
fflush(f);to flush the buffer at a certain point.setbuf(f, NULL);to disable buffering.Where
fis obviously yourFILE*.ie.
OR