Record Case Detail

Notes

This function is in beta test. Please help improve it in the issues here.

Stderr

=================================================================
==26393==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffd85789b10 at pc 0x5599ca04c776 bp 0x7ffd857898e0 sp 0x7ffd857898d0
READ of size 8 at 0x7ffd85789b10 thread T0
    #0 0x5599ca04c775 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::length() const (/out/package/ex1+0x16775)
    #1 0x5599ca04da10 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+0x17a10)
    #2 0x5599ca04b329 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+0x15329)
    #3 0x5599ca04bb36 in main (/out/package/ex1+0x15b36)
    #4 0x7fb1bbe37b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+

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