I'm having trouble figuring out how to filter out all non-letter characters from my program. Would you have to do something with the ASCII code or what?Also for some reason, my program says it's not a palindrome if I write "He lived as a devil, eh?" even though it clearly is.
Here's my code so far:
Any help is appreciated.Code:#include <stdio.h> #include <string.h> int main() { char str1[60], str2[60]; printf("Enter the string for palindrome check:"); scanf("%s", &str1); strcpy(str2, str1); strrev(str2); if(strcmp(str1, str2)==0) { printf("%s is a palindrome.", str1); } else printf("%s is not a palindrome.", str1); return 0; }