I need to read text from stdin that can be up to 1000 lines long, but potentially less. How can I get this input into one string?
string s;
string line;
while (cin) {
getline(cin, line);
s += line;
}
This runs forever and I can never use string s