Its limitation is when we try to save a string with white spaces (several words are involved).
The user input is "Hello there! Are you okay?", but only the first word, "Hello" is stored to variable str.
To include all words, we will use the function getline().
If you want to know more about getline(), visit the link below.
http://www.cplusplus.com/reference/string/getline/
To include all words, we will use the function getline().
If you want to know more about getline(), visit the link below.
http://www.cplusplus.com/reference/string/getline/
No comments:
Post a Comment