+ 2
Why is my code not giving any output?
https://code.sololearn.com/cTzI6F7fOqex/?ref=app Whenever i run my program, it gives a runtime error. Theres no problem with the syntax but i guess i am using pointers incorrectly here. Could anyone explain whats wrong here. Thanks!!😊
3 Antworten
+ 3
You had non-space characters as your indents. Your code doesn't quite work (kept a space and lost a character.)
https://code.sololearn.com/cAnHp8cd1cNR
+ 3
Sorry, I missed your post notification. I fixed my code, if you still care.
+ 1
Thanks alot John Wells for pointing out the mistake. I still dont quite understand the problem here. I do realize that my program keeps a space and loses a character but i dont quite understand why that is the case. Like am i finding the wrong values for first and last or is there a problem in my string (trimmed).
Thanks!!