How do I take standard input of several lines and store it into a std::streamstring
until the user presses Ctrl-D to signal end of input? I'd like to do something like this but for variable lines of input. How can I check for end of transmission signal as signaled by a Ctrl-D press by the user?
string std_input;
stringstream stream(std_input);
while (getline(cin, std_input))
stream(std_input);