C++ 读取文件内容赋值给变量

来源:互联网 发布:中企动力域名查询 编辑:程序博客网 时间:2024/05/21 03:54
#include ifstreamifstream file;file.open("abc.txt",ios::in);string str1,str2;file>>str1;//将读入的第一个字符串赋值给str1,按照空格来识别不同的字符。

原创粉丝点击