ofstream不会创建文件

时间:2014-10-10 15:21:37

标签: c++ file stream

#include <iostream>
#include <fstream>

using namespace std;

int main()
{
    ifstream infile("text.txt", ios_base::in); // this works
    ofstream outfile("C:/output.txt", ios_base::out); // doesn't
    outfile << "hi";

    return 0;
}

没有创建文件。有什么问题?

0 个答案:

没有答案