Notes
This function is in beta test. Please help improve it in the issues
here.
ASAN:DEADLYSIGNAL ================================================================= ==31712==ERROR: AddressSanitizer: SEGV on unknown address 0x611762d9f640 (pc 0x55cd3f72525c bp 0x7ffc3b16ccd0 sp 0x7ffc3b16ccc0 T0) ==31712==The signal is caused by a READ memory access. #0 0x55cd3f72525b in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_data() const (/out/package/ex1+0x1025b) #1 0x55cd3f724b9d in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (/out/package/ex1+0xfb9d) #2 0x55cd3f723114 in findSingleWord(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&) (/out/package/ex1+0xe114) #3 0x55cd3f7238bf in main (/out/package/ex1+0xe8bf) #4 0x7f8f32655b96 in __libc_start_main (/lib/x86_64
Hints
Your answer may be identical to the JOJ answer in the first several lines.
However, the main problem you meet now is Runtime Error. And the exit code of your program is 1, which should be 0.
Please double check your code to solve this problem and try again.
Your Answer
JOJ Answer
happy