'Creating file with ofstream does not work in Qt, why?
Why below code is not working on Qt (MinGW compiler):
auto cDir = QDir::currentPath();
ifstream dFile("3.txt", std::fstream::in);
ofstream f1;
ofstream f2("0.txt", std::fstream::out);
f1.open("1.txt", std::ios::out | std::ios::trunc);
if (f1.is_open())
return 0;
if (f2.is_open())
return 1;
dFile is fine, opened and can be read. f1 and f2 are not opened (if exist) nor created.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
