#include <fstream>
std::ifstream fileInput("filename.txt");
if (fileInput.is_open())
if (fileInput.good())
std::string line; //声明一个字符串变量 line
while (std::getline(fileInput, line)) {
//在这里处理 line 变量
}
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |