09-18-2019 06:09 AM
Hello everyone,
I have to open ,read , extract data and modify its format from many cvs files. Then I have to write or copy the extracted data into a new txt/cvi File.
I've read,opened and extracted some data in a Buffer but I couldn't write them in the txt file created at the beginning .So that I need your help.
ps: I didn't really get how the function "WriteFile" does work
thank you in advance
09-18-2019 07:18 AM
Why are you calling WriteFile at all? An output buffer is written to disk when the file is closed and you have an fclose at the end of the code: isn't it writing the file? Throw all those WriteFile away: they are meaningless (and the compiler should complain about you passing a string instead of a file handle to them!).
WriteFile is more or less the same as fputs, but as a general rule you cannot mix functions from ANSI C and Formatting and I/O libraries: if you open a file with fopen you cannot the operate on it with WriteFile since ANSI C library uses FILE * handles while Formatting and I/O handles are simply integer values.