Question 9
Back to Exercise
Which statement about std::string_view is true?
- A It copies the string
- B It is a non-owning view (pointer + length); the viewed characters must outlive it Correct
- C It is always null-terminated
- D It can modify the string
Correct Answer: Option B
Its data() is not guaranteed to be null-terminated either.
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!