santakdalai90
22nd October 2009, 21:18
Can anyone please explain file handling in Qt?
Please specify how a file is created. I was earlier using c++, so please give an equivalent Qt code for the following.
#include <fstream>
int main()
{
ofstream file("file1.txt");
string s = "how are you?";
file << s;
}
the problem is that ofstream creates a file if it doesn't exist. But Qfile does not.
Please specify how a file is created. I was earlier using c++, so please give an equivalent Qt code for the following.
#include <fstream>
int main()
{
ofstream file("file1.txt");
string s = "how are you?";
file << s;
}
the problem is that ofstream creates a file if it doesn't exist. But Qfile does not.