It's certainly confusing, but straightforward once the concept is understood. Formatted input methods ignore leading whitespace. Unformatted input methods don't ignore leading whitespace. The newline character is whitespace. Finally, getline() terminates when it detects a newline.
So the pattern where getline() is "skipped" would be formatted input followed by getline(), which is unformatted:
cin >> x;
getline(cin, y); // Likely to be "skipped"
Now, I say "skipped" because getline() isn't really being skipped. It's being called and successfully terminating after reading the first character, which is a newline. The reason people say it's being "skipped" is because they don't realize the newline is there or what it represents to getline().
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
leaves the stream as unformatted
The stream is nothing more than a series of characters. The difference between formatted and unformatted is how you read those characters.
For example, getline() is an unformatted operation; it simply grabs characters up to a newline and doesn't require those characters to be in any special format. operator>>() is a formatted operation; it tries to interpret a value of the specified type and perform a conversion. If the characters aren't formatted as expected for a value of the specified type, the operation fails.
You're overcomplicating things. The root of the problem is that operator>>() stops reading at whitespace and leaves it in the stream. That's not a problem if the next operation is another call to operator>>() because it also ignores leading whitespace. But if the next operation is something that doesn't expect whitespace, there can be a problem.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401