SMS decryption in C | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

SMS decryption in C

I have a problem with the code below. It runs fine on Solo learn. But when I run it on another IDE (my system or C++ android app), it dosen't decrypt the last word. So if I input "d gf" it will output "the gf" instead of "the girlfriend". So can you please run this code on another IDE and tell me why it isn't processing the last word but Sololearn is doing so. https://code.sololearn.com/cLOLJQbH30ah/?ref=app

23rd Dec 2020, 11:04 PM
Sekiro
Sekiro - avatar
5 Answers
+ 3
Hi I deleted my original post as my suggestion worked in my IDE but not in sololearn.... weird. anyway...see my previous posted link which now works in both.
23rd Dec 2020, 11:55 PM
rodwynnejones
rodwynnejones - avatar
+ 2
I initially though the the newline character (which is considered part of the string when using fgets()) was the problem..but it wasn't... so just coded it the way I though it would work. sending the pointer to the sms in the while loop.
24th Dec 2020, 12:01 AM
rodwynnejones
rodwynnejones - avatar
23rd Dec 2020, 11:49 PM
rodwynnejones
rodwynnejones - avatar
0
rodwynnejones thanks. It worked. Can you explain how that made it work please?
23rd Dec 2020, 11:51 PM
Sekiro
Sekiro - avatar
0
rodwynnejones Thanks a lot. I was really confused. Thanks. This does bring up another question as why Sololearn isn't working the same way as other IDE's. But thanks for your help
24th Dec 2020, 12:28 AM
Sekiro
Sekiro - avatar