LearnFrenzy
Sign in Take a free test

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

What is std::istringstream used for? Answer, explanation & discussion

  • MCQ
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
Question 16 Back to Exercise

What is std::istringstream typically used for?

  • A Reading files
  • B Extracting values from a string with >> and getline, exactly like reading from cin Correct
  • C Converting a number to a string only
  • D Network communication
Correct Answer: Option B

It is declared in <sstream>. A common pattern is getline a line from cin, then parse it with an istringstream.

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