I have created a
On linux/unix, it doesn't matter whether you specify
"w" to create a file.
But creating a text file using
fopen in windows means that all
\n are converted to
\r\n, so if you're using this to create binary files, the binary files will be "corrupt" if there are some bytes with value "10" (linefeed)
Simple solution: always use
fopen("file.bin","wb") when creating a binary file, on all platforms so your code is portable.