1.输出
指输出到文件
#include <iostream> #include <fstream> using namespace std; int main() { ifstream in; ofstream out; out.open("m", ios::out);//建立输出文件m char word[] = "Welcome"; int date = 20220313; out << word << endl << date;//输出到out对应的m文件 return 0; }
有out.open,它自己建了文件,不用自己建。
【听说有人想转码】文件读写
最新推荐文章于 2024-07-25 18:34:51 发布