I have this program that would run a Palindrome, but it includes blank spaces, punctuation, and is case-sensitive. And i need to ignore the blank spaces, punctuation and case-sensitive. the hint given to figure it out is
bool is_letter(char c);
and
char to_lower(char c);
I would start my making a second string that consists of just the letters in s, converted to lower case. So if s is "I HATE my class!!" then the new string would be "ihatemyclass".
Once you have that string you can check for a palindrome easily.
Also, the algorithm that you're using is inefficient. You're creating a new string and doing a recursive call each time, so if palindrome is 100 characters then you create 50 new strings. You could do it easier by comparing characters at the front and back of the string and working your way in towards the middle.
you would need to create a function which takes the string of the palindrome and puts it either all upper case or all lower case
in my example, i made it all upper case
1 2 3 4
for (int i = 0; word[i] != '\0'; i++) //as long as word does not equal null
{
word[i] = toupper(word[i]); //initialize each word in sentence to uppercase
}