0

Secret message - code coach

I was trying to do code coach secret message. Here is my code in c++ https://code.sololearn.com/cb2qlbIQ5acs/?ref=app This code is passing 4 out of 5 test but get failed in test-4 I don't have sololearn premium so i can't see what is going wrong Any sololearn premium user please check this code

28th Aug 2022, 7:07 AM
Dipankar Shaw
Dipankar Shaw - avatar
2 Answers
0
You are writing into an empty string, which is undefined behaviour. Either construct `ec_text` with a sufficient initial size, i.e. `len`, or make it a char instead (since you write the output character by character anyway).
29th Aug 2022, 9:09 AM
Shadow
Shadow - avatar
0
Shadow thanks pal
29th Aug 2022, 10:21 AM
Dipankar Shaw
Dipankar Shaw - avatar