小编pen*_*uin的帖子

无法输出到文本文件,文件为空

我试图将一堆变量输出到制表符分隔的文本文件中,但一旦程序完成,结果文件就完全为空.

string outFileName = "/Users/hbll-diteam/Desktop/" + identifier + ".csv";
        ofstream out(outFileName.c_str());
        out.open(outFileName);
        if(out.is_open())
        {
            //cout << ";eruigjnsldfijuglsidufblg yay";
            out << coCDM_LVL << '\t' << coCDM_LVLname << '\t' << creator << '\t' << contributors << '\t' << coTitle << '\t' << altTitle << '\t' << description << '\t' << dateOriginal << '\t' << dateSpan << '\t' << edition << '\t' << publisher << '\t' << physicalDescription << '\t' << scale << '\t' << extentField << '\t' << medium << '\t' << …
Run Code Online (Sandbox Code Playgroud)

c++ text file ofstream output

3
推荐指数
1
解决办法
63
查看次数

标签 统计

c++ ×1

file ×1

ofstream ×1

output ×1

text ×1