reading in lines from a file to a vector c 2b 2b

Solutions on MaxInterview for reading in lines from a file to a vector c 2b 2b by the best coders in the world

showing results for - "reading in lines from a file to a vector c 2b 2b"
Gabriele
05 May 2018
1std::string str;
2// Read the next line from File untill it reaches the end.
3while (std::getline(in, str))
4{
5    // Line contains string of length > 0 then save it in vector
6    if(str.size() > 0)
7        vecOfStrs.push_back(str);
8}