📜  从文件中读取行到向量 c++ 代码示例

📅  最后修改于: 2022-03-11 14:44:48.481000             🧑  作者: Mango

代码示例1
std::string str;
// Read the next line from File untill it reaches the end.
while (std::getline(in, str))
{
    // Line contains string of length > 0 then save it in vector
    if(str.size() > 0)
        vecOfStrs.push_back(str);
}