The program does not crash but just freezes and becomes unresponsive. When I stop the program and take out the SD the new file is created, but no data is written in it. I’m assuming it’s a problem with the while() loop but I’m not sure why. Also the SD card I’m using is: SD card
not sure exactly what the problem is, but tempChar should be an int and you should check that the file pointers are valid before using them. This is how I might write it in VEXcode.
The problem was having it as a char value, thank you! Just look it up and EOF is commonly defined with a -1 value, so I would venture to guess char values are unsigned by default in this compiler causing it to infinitely loop.