tags:

views:

149

answers:

2

i want to put a newline into a txt file, i tried with many alternative with so many help from this forum but 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();
  }
+1  A: 

Try out << endl;

Stu Mackellar
A: 

When you open the file:

data.open(QFile::Append | QFile::Text)

Ami