實現n檔案讀取(一)
阿新 • • 發佈:2018-11-28
int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QStringList ab; QString abc; //QList<QString> list; QFile file("C:\\Users\\L\\Desktop\\brdc3000.18n"); if(file.open(QIODevice::ReadOnly)) { QTextStream stream(&file); //QTextStream abcd("END OF HEADER"); //QString line("END OF HEADER"); bool a = stream.seek(0); abc= stream.readLine(); //stream.readAll(); } QFile file_2("C:\\Users\\L\\Desktop\\新建文字文件.txt"); if(file_2.open(QIODevice::WriteOnly | QIODevice::Text)) { QTextStream out(&file_2); out<<abc; } file_2.close(); return a.exec(); }