Use of Getline

Why do we use getline to in any palindrome program?
getline reads the whole line. operator>> only reads one word.
Getline reads all the way until a new line is formed. >> only reads until a space.
closed account (zybCM4Gy)
It's also far less error prone and can be manipulated far easier. Although with the advent of C++11 that's less of a problem.

But the primary reason is to deal with phrases.
Topic archived. No new replies allowed.