Notes
This function is in beta test. Please help improve it in the issues
here.
================================================================= ==10137==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7ffe6f58dc10 at pc 0x00000051c7b5 bp 0x7ffe6f58db30 sp 0x7ffe6f58db28 READ of size 4 at 0x7ffe6f58dc10 thread T0 #0 0x51c7b4 (/out/package/calc_mem+0x51c7b4) #1 0x7f7599f1fc86 (/lib/x86_64-linux-gnu/libc.so.6+0x21c86) #2 0x41d879 (/out/package/calc_mem+0x41d879) Address 0x7ffe6f58dc10 is located in stack of thread T0 at offset 208 in frame #0 0x51a0df (/out/package/calc_mem+0x51a0df) This frame has 10 object(s): [32, 33) '__c.addr.i' [48, 56) '__endptr.i.i' [80, 112) 'str' (line 19) [144, 148) 'sum' (line 72) [160, 164) 'sub49' (line 96) [176, 180) 'product' (line 120) [192, 196) 'devide' (line 152) [208, 212) 'neg' (line 176) <== Memory access at offset 208 is inside this variable [224, 228) 'copy1' (line 197) [240, 244) 'copy2' (line 198) HINT: this may be a false positive if your program uses some custom stack
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
is int numop = 1
JOJ Answer
-1