std::ifstream txtfile;//打开读取的文件
std::string temp;
std::string file_path = R"(D:\\chengxu\\py\\new_file.yml)";
txtfile.open(file_path, std::ios::in);
while (!txtfile.eof()) // 若未到文件结束一直循环
{
getline(txtfile, temp);//一行一行读取
bool flag = false;
}
按行读取文件内容
最新推荐文章于 2023-04-24 11:15:13 发布