Notes
This function is in beta test. Please help improve it in the issues
here.
================================================================= ==35265==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x603000000030 at pc 0x5620f2b29222 bp 0x7ffde362b120 sp 0x7ffde362b110 READ of size 8 at 0x603000000030 thread T0 #0 0x5620f2b29221 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_data() const (/out/package/ex1+0x11221) #1 0x5620f2b28a07 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+0x10a07) #2 0x5620f2b26ed5 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+0xeed5) #3 0x5620f2b2766b in main (/out/package/ex1+0xf66b) #4 0x7f2538b92b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x
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
me