I want to iterate over std::cin, line by line, addressing each line as a std::string. Which is better:
std::cin
std::string
string line; while (getline
The first one.
Both do the same, but the first one is much more readable, plus you get to keep the string variable after the loop is done (in the 2nd option, its enclosed in the for loop scope)