If you're learning C++, one surprisingly common source of confusion is input. Why does this: std :: cin >> text ; only read one word? Why does std::getline() sometimes seem to skip an input? And why does reading text from a file suddenly print every word on a separate line? The answer becomes much simpler once you understand that C++ has two different ideas here: reading a value and reading a line . That's also the idea behind my small head...