0
當writeToFile函數被調用時,我想在文件中用字符串寫一個新行。這可能沒有清除前面的行或整個txt?上一行被清零
void writeToFile(string str) {
ofstream fileToWrite;
fileToWrite.open("C:/Users/Lucas/Documents/apps/resultado.txt");
if(fileToWrite.good()) {
//write the new line without clearing the txt
//fileToWrite << str won't work for this reason
}
fileToWrite.close();
}