Notes
This function is in beta test. Please help improve it in the issues
here.
ASAN:DEADLYSIGNAL ================================================================= ==70635==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000010 (pc 0x5570049e588e bp 0x7ffcc20f3390 sp 0x7ffcc20f3380 T0) ==70635==The signal is caused by a READ memory access. ==70635==Hint: address points to the zero page. #0 0x5570049e588d in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size() const (/out/package/ex3+0x1688d) #1 0x5570049e5473 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const (/out/package/ex3+0x16473) #2 0x5570049e3509 in Station::passengerGetOff(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int) (/out/package/ex3+0x14509) #3 0x5570049e7e4c in main (/out/package/ex3+0x18e4c) #4 0x7ff250c42b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) #5 0x5570049e0b
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
Passengers getting off bus 100...
JOJ Answer
Error: bus 100 not found! Welcome to the station! Current number of buses: 0 Error: Station is empty!