Explain how whitespace characters are handled in the string input operator and in the getline function
belongs to book: C++ Primer|Stanley B.Lippman, Josee Lajoie, Barbara E.Moo|5th Edition| Chapter number:3| Question number:3.3
All Answers
total answers (1)
*Whitespace characters* include space, newline and tab.
need an explanation for this answer? contact us directly to get an explanation for this answerThe `string` input operator `<<` will regard all three kinds of whitespace characters as delimiter, so the string read from the operator will contain no whitespace characters.
The `getline` function will regard only the newline character as delimiter, so the string read from `getline` function will contain no newline character but may contain space or tab.