Alles rund um die Programmierung mit Qt
-
pospiech
- Beiträge: 232
- Registriert: 1. September 2006 17:20
- Wohnort: Hannover
Beitrag
von pospiech »
Ich schreibe Daten in eine Textdatei und erhalte jedesmal am Ende eine zusätzliche leere Zeile. Das bringt dann Fehler beim Einlesen.
Ich mache das so:
Code: Alles auswählen
QTextStream out(&file);
for (int x = 0; x < (int)VariationList.size(); x++)
{
out << VariationList[x].delay << "\t"
<< VariationList[x].period << "\t"
<< VariationList[x].phase << endl;
}
file.close();
Was müsste ich ändern, damit ich keine leere Zeile am ende erhalte?
Matthias
-
-=Freaky=-
- Beiträge: 503
- Registriert: 29. Dezember 2006 22:54
- Wohnort: HL
Beitrag
von -=Freaky=- »
Code: Alles auswählen
QTextStream out(&file);
for (int x = 0; x < (int)VariationList.size(); x++)
{
out << VariationList[x].delay << "\t"
<< VariationList[x].period << "\t"
<< VariationList[x].phase;
if( x != (int)VariationList.size() - 1 )
out << endl;
}
file.close();
so irgendwie?
es wird ja sonst nach jeder zeile ein zeilenumbruch ausgegeben, auch nach der letzten.
mfg,
julian