发布网友 发布时间:2022-04-24 06:50
共2个回答
热心网友 时间:2022-06-17 04:36
int fileNum = open("your path", O_WRONLY | O_CREAT | O_APPEND, 02); //打开,创建,追加
string temp = "just temp";
3. ssize_t i = write(fileNum,bb.data(), bb.length()); //写入
用C 都可以了吧..要回车加上\n 啊
热心网友 时间:2022-06-17 04:36
#include <QFile>
QFile file("E:/test.txt");
if (!file.open(QFile::WriteOnly | QFile::Text))
{
QMessageBox::information(this, "Error Message", "Please Select a Text File!");
return;
}
QTextStream out(&file);
out << ""+ yourstr +"\n";