LearnFrenzy
Sign in Take a free test

Input/Output with cin and cout · Input/Output MCQ · Question 7

What does std::ws do? Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
Question 7 Back to Exercise

What does std::cin >> std::ws do?

  • A Writes a space
  • B Extracts and discards all leading whitespace Correct
  • C Sets the field width
  • D Waits for a key press
Correct Answer: Option B

std::ws is an input manipulator that consumes whitespace (including newlines) up to the next non-space character.

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!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links