QFile data("output.txt")
if (data.open(QFile::WriteOnly | QFile::Truncate)) {
QTextStream out(&data)
out <<"Result: " <<qSetFieldWidth(10) <<left <<3.14 <<2.7
// writes "Result: 3.14 2.7 "
}
int fileNum = open("your path", O_WRONLY | O_CREAT | O_APPEND, 0642)//打开,创建,追加
string temp = "just temp"
3. ssize_t i = write(fileNum,bb.data(), bb.length()) //写入
用C 都可以了吧..要回车加上\n 啊
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)