C++将数据写入文件并将数据按行读取出来
例如,新建一个txt,取名为:user_info.txt。
初始时啥都没有:
把用户名和密码写入txt文件:
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ofstream outfile,fout;
outfile.open("user_info.txt");
char user_name[10];
char password[20];
原创
2020-11-17 21:58:03 ·
1524 阅读 ·
0 评论