Skip to main content
Journey Uncommon Logo
JourneyUncommon
easyC++string and string_viewSingle-choice MCQ

Why is the following code a serious bug?

std::string_view make() { std::string s = "hello"; return s; } // caller: std::string_view sv = make(); std::cout << sv;