小编Ish*_*aan的帖子

ifstream和ofstream或fstream使用in和out

处理文件时,首选以下两个例子中的哪一个?一个人提供比另一个更好的表现吗?有什么不同吗?

ifstream input("input_file.txt");
ofstream output("output_file.txt");
Run Code Online (Sandbox Code Playgroud)

VS

fstream input("input_file.txt",istream::in);
fstream output("output_file.txt",ostream::out);
Run Code Online (Sandbox Code Playgroud)

c++ fstream ifstream ofstream

9
推荐指数
1
解决办法
1万
查看次数

标签 统计

c++ ×1

fstream ×1

ifstream ×1

ofstream ×1