Problems writing a txt file
General and Desktop
4
Posts
2
Posters
1.5k
Views
1
Watching
-
Hi everybody!
Im having trouble writing a txt file.
Im supposed to keep a log on my program, and each time a certain "event" happens, im supposed to write it on a txt file, with the date and time.
The program works, but i dont know why, it adds a couple of strange characters at the beggining of each line.This is my code:
@
void Grabador::escribir_log(QString data)
{
QFile log("log.txt");
log.open(QIODevice::Append|QIODevice::WriteOnly);
QDataStream out(&log);
out<<data.toAscii();
log.close();
}
@ive debugged the program and im sure that the information on data is correct.
But after i run the program, this is how my log looks like