Answers for "reading in lines from a file to a vector c++"

C++
0

reading in lines from a file to a vector c++

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);
}
Posted by: Guest on September-18-2021

Code answers related to "reading in lines from a file to a vector c++"

Browse Popular Code Answers by Language