I am programming on Windows right now, but portable code would also be welcome.
What I'm using now is fwrite(4), but this function requires the maximum number of elements that will be written to the file. I can use it strlen(1)here, but I would like to know if there is a better way to do this.
source
share