Newline character into textfile using QFile
i want to put a newline into a txt file, i tried with many alternative with so many help from this forum b开发者_如何学运维ut i am getting always unknown character always. Please help
for (int i = 0; i < fileDet.size(); i++) {
qDebug() << "Name directory" << fileDet.at(i);
QFile data("output.txt");
if (data.open(QFile::Append)) {
QTextStream out(&data);
out << fileDet.at(i); //<<'\n';
out << QChar((int)'\n');
}
data.close();
}
Try out << endl;
When you open the file:
data.open(QFile::Append | QFile::Text)
精彩评论