Notes
This function is in beta test. Please help improve it in the issues
here.
================================================================= ==63655==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffeed9f6ca1 at pc 0x0000004a8e29 bp 0x7ffeed9ea6d0 sp 0x7ffeed9e9e80 WRITE of size 2 at 0x7ffeed9f6ca1 thread T0 #0 0x4a8e28 (/out/package/ex6+0x4a8e28) #1 0x4a9da8 (/out/package/ex6+0x4a9da8) #2 0x4a9e8e (/out/package/ex6+0x4a9e8e) #3 0x514fbe (/out/package/ex6+0x514fbe) #4 0x5155c8 (/out/package/ex6+0x5155c8) #5 0x7fac71203b96 (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) #6 0x41c959 (/out/package/ex6+0x41c959) Address 0x7ffeed9f6ca1 is located in stack of thread T0 at offset 50305 in frame #0 0x514d2f (/out/package/ex6+0x514d2f) This frame has 5 object(s): [32, 50032) 'sen' (line 8) [50288, 50292) 'op' (line 17) [50304, 50305) 'c' (line 22) <== Memory access at offset 50305 overflows this variable [50320, 50321) 'd' (line 28) [50336, 50337) 'e' (line 45) HINT: this may be a false positive if your program uses some
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
Input a string: * Choose 1 to replace a character or 2 to delete a character: Replace character: with: New string: x ertrgd j ynqwfvkd hyw yb ufo efxo me ltoiortrnefxi fuqg ooqlqgx njnzqm bqpmm grzbtzpfpfxno gmnle