Quote:
Originally Posted by byteit101
slightly off topic, but why are you using C style IO when C++ IO is available? In 09 we successfully used fstream IO with just "file.ext" style and "existingdir/file.ext" style open args
Code:
fstream file;
file.open("test.txt");
if (!file.is_open())
{printf("failed to open"); return false;}
file>>floatTest;
//and later we have something similar in order to write using fprintf
file<<floatTest;
|
Both ways are perfectly okay, depends on preference. We (114) like to use C-style I/O because it seems easier to use (for us).
Also, don't forget to call fclose or file.close() function before you exit.