如何打开QFile进行追加,即相当于
FILE *f = fopen("myfile.txt", "a");
解决方法:
在QIODevice :: Append模式下打开文件:
QFile f(...);
if (f.open(QIODevice::WriteOnly | QIODevice::Append)) {
...
}
2024-03-17 22:15:28
如何打开QFile进行追加,即相当于
FILE *f = fopen("myfile.txt", "a");
解决方法:
在QIODevice :: Append模式下打开文件:
QFile f(...);
if (f.open(QIODevice::WriteOnly | QIODevice::Append)) {
...
}