Because there is a default manipulator/flag set on cin to discard those specific characters but when u call cin.get(ch) the get() is defined to capture any character input into the stream. For cin >> ch; to have the same behavior simply place this line before it cin >> noskipws;