I\'m trying to read an entire stream (multiple lines) into a string.
I\'m using this code, and it works, but it\'s offending my sense of style... Surely there\'s an
What about to use getline with delimiter? The next code helps me to read whole std::cin into string on ubuntu with g++-10.
#include #include using namespace std; int main() { string s; getline(cin, s, {}); //the whole stream into variable s return 0; }