13.12.2011, 18:03
You called fwrite() on inalid file handle == 0, you should always check if a file is fopen()'ed correcly by checking its return value against 0 before writing to/reading from it. I also can admit that the string it was trying to write starts with 'S'.