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();
}