Notes
This function is in beta test. Please help improve it in the issues
here.
/in/ex6.c:12:32: runtime error: member access within misaligned address 0xbebebebebebebebe for type 'struct book', which requires 8 byte alignment 0xbebebebebebebebe: note: pointer points here <memory cannot be printed> ASAN:DEADLYSIGNAL ================================================================= ==46791==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x563bad94d79f bp 0x7ffd475c2800 sp 0x7ffd475c27f0 T0) ==46791==The signal is caused by a READ memory access. ==46791==Hint: address points to the zero page. #0 0x563bad94d79e in findBook (/out/package/ex6+0x379e) #1 0x563bad94dfac in main (/out/package/ex6+0x3fac) #2 0x7f9d4ffebb96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) #3 0x563bad94d609 in _start (/out/package/ex6+0x3609) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV (/out/package/ex6+0x379e) in findBook ==46791==ABORTING
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
Linked-List: 5067->2992->1161->1986->3821->3215->3289->503->2593->3061->3184->2522->4245->3650->1647->5682->854->5094->375->3605->5002->254->5712->846->445->869->2848->2367->300->368->2622->5129->6194->745->3318->2670->2276->3519->2118->5016->1582->2923->4763->2796->4801->5307->5497->91->2168->4093->4->6009->4843->4197->126->569->2480->5945->3419->4676->231->4100->3523->4669->5999->3460->3985->5395->2301->834->169->5656->3499->4710->5186->1404->2135->2359->5450->2007->1731->122->1717->380->5397->3331->1269->3188->3297->1152->1762->4301->5019->3257->1356->3207->5199->1074->2845->3535->1659->2517->2095->2575->4875->2154->128->628->1176->290->1350->924->434->1159->2209->34->117->3474->1043->4381->552->2287->3663->50->5063->2330->2410->1664->5614->327->3488->1132->5890->6141->4495->4246->3026->6038->1326->2299->1904->2239->4915->400->1042->783->1038->1936->2921->4956->2766->502->3424->3380->5888->3399->2916->2082->224->330->2685->3547->2837->1644->5163->4657->4968->726->6182->5286->3584->1504->1197->6179->1409->1