0
Palindrome problem
If I run the code as written it works fine with word in main function defined up front. If I try and change the main function to accept input with fgets or scanf I get core dump error. Can anyone tell me why? https://code.sololearn.com/cOhpw23t893N/?ref=app
6 RĂ©ponses
+ 3
Remove the orgc size 25. like just orig[] then try...
orgc[25]={r,a,s,e,s,a,r};
Then strlen(orig) will return 25 not 7.
Then orig[origlength - (i+1)] =>orig[25] =>fatal error...
+ 1
Thanks a million devanville!
0
Thank you to both! I think either way i had to initialize j but also didnt know i could pass a string into function with empty [].