Well first off I'd like to say that this is an amazing site. An absolute treasure trove of information.
Searching through the trove though, I didn't find an answer to my question. Hopefully someone can shed some light on it.
I am a beginner at C++, but would like to know what would be the most reliable way to have a string input from the user.
Using cin >> is no good, since it is delimited by whitespace.
I used getline(), but for some reason the user has to input two new lines before advancing in the program.
A solution to this is to use cin.getline() and have it saved into a char, but the main problem with both getline functions is if the user immediately presses enter everything goes to hell. Something at least cin >> could deal with.
So my solution has been:
Unlike cin of course it does read past whitespace, and in case the user presses enter as first input the request is repeated.
} while ( mystring == '\0' );
How is this problem normally tackled? What could be done better?
Thanks in advance.