#include <bits/stdc++.h> #include <fstream> using namespace std; int main(int argc, char** argv) { char data[100]; ofstream a; a.open("hehe.txt"); cout<<"请写下你想对你的班主任的话,呵呵"; cin>>data; a<<data<<endl; a.close(); ifstream b; b.open("haha.txt"); cout<<"现在我来告诉你!"; b>>data; cout<<endl; cout<<data<<endl; b.close(); return 0; }
标签:文件,cout,int,写入,char,读入,include,data From: https://www.cnblogs.com/fushuxuan/p/17808345.html