Notes
This function is in beta test. Please help improve it in the issues
here.
================================================================= ==49476==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffd090ce14f at pc 0x55e61461b61d bp 0x7ffd090cab70 sp 0x7ffd090cab60 READ of size 1 at 0x7ffd090ce14f thread T0 #0 0x55e61461b61c in calc (/out/package/lab4+0xc61c) #1 0x55e61461d5fa in calcExp (/out/package/lab4+0xe5fa) #2 0x55e614617dfe in main (/out/package/lab4+0x8dfe) #3 0x7f4c8b6bab96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) #4 0x55e614618669 in _start (/out/package/lab4+0x9669) Address 0x7ffd090ce14f is located in stack of thread T0 at offset 863 in frame #0 0x55e61461720f in main (/out/package/lab4+0x820f) This frame has 9 object(s): [32, 384) 'myVar' [416, 426) 'temp' [480, 491) 'cvarname' [544, 664) 'str' [704, 824) 'command' [864, 984) 'optpar' <== Memory access at offset 863 underflows this variable [1024, 1144) 'optpar' [1184, 1304) 'rem' [1344, 1464) 'expr' HINT: this may be a
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
250.000000 0.500000 250.000000 62253.000000 64.000000 7091.000000 2.550000 -2490.000000 -22.350000