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!