difference between cin.get(ch) and getch()?

1) difference between getch() and cin.get(ch).
2)char ch;
why does cin.get(ch) read space,new line or tab but,cin>>ch does not?
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;
Last edited on
Topic archived. No new replies allowed.