Question 14
Back to Exercise
What is the difference between std::cin.get(c) and std::cin >> c for a char c?
- A None
- B get(c) reads the next character even if it is whitespace; >> skips whitespace first Correct
- C get(c) reads a whole word
- D >> reads only digits
Correct Answer: Option B
Use get when spaces and newlines matter, e.g. counting characters or reading a text verbatim.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!