I have a std::string with multiple lines and I need to read it line by line. Please show me how to do it with a small example.
std::string
Ex: I have a string
#include #include int main() { std::istringstream f("line1\nline2\nline3"); std::string line; while (std::getline(f, line)) { std::cout << line << std::endl; } }