Notes
This function is in beta test. Please help improve it in the issues
here.
================================================================= ==47692==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x611000000388 at pc 0x7fad934e066e bp 0x7fffa9d12a50 sp 0x7fffa9d121f8 READ of size 201 at 0x611000000388 thread T0 #0 0x7fad934e066d (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x5166d) #1 0x5639c756c5bf in RVPcalculation (/out/package/lab4+0xf5bf) #2 0x5639c756988e in main (/out/package/lab4+0xc88e) #3 0x7fad92000b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) #4 0x5639c756c319 in _start (/out/package/lab4+0xf319) 0x611000000388 is located 0 bytes to the right of 200-byte region [0x6110000002c0,0x611000000388) allocated by thread T0 here: #0 0x7fad9356db40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40) #1 0x5639c7571764 in var_RVPcalculation (/out/package/lab4+0x14764) #2 0x5639c756988e in main (/out/package/lab4+0xc88e) #3 0x7fad92000b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96
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
Show the results! a * b = 70.910000, b - c + a * f = 13932.010000 ans = -7062633.450000