Homework help - small error?

Palindromes are words or phrases that read the same backwards as forwards. Write a C++ program that indicates whether each line on an input file, called sentences.txt and given on my homepage, contains a palidrome. Those lines of sentences.txt that are palidromes should be written to an output file, called palindromes.txt.

The input file given:

Vanna, wanna V?
Must sell at tallest sum.
I should get an eighty. Why? Because I get an eighty in all my other classes.
Lager, Sir, is regal.
I don't need documentation. The code is obvious to me. OK, but is it to the next programmer?
Evil olive.
I never thought computer science could be such fun!
Sex at noon taxes.
You expect me to read ten chapters in two days? No, I expect you to read ten chapters over the semester.
Never odd or even.

Keep in mind for now I'm just testing with cout rather than the output file until I get it to work.

The issue is that it only prints the first sentence and I'm not entirely sure why. I'm pretty sure it isn't something wrong with obtaining the sentence input because of a test that I did earlier, but suspect that something might be wrong with my function to test whether or not the sentence is a palindrome.

My exact output:

Vanna, wanna V?

Any help would be greatly appreciated, I have a feeling it's just a simple error on my part.

In isPalindrome() strip the punctuation and spaces from temp before testing. Don't just advance indexes.

Use i to be the letter in front to test and use j to be letter in back to test. i starts at zero. j starts at length of temp when all spaces and punctuation have been removed minus one. Each time through the loop increment i and decrease j by one. The loop should stop when i is one half the starting length of temp after spaces and punctuation removed.

Throw in the output statements after each file read, after each conversion to lower case, after each removal punctuation/spaces (if you go that route) and output each letter before it is compared. Continue this type of investigation with other variables if need be until you pinpoint the problem.

Vanna, wanna V?
Must sell at tallest sum.
I should get an eighty. Why? Because I get an eighty in all my other classes.
Lager, Sir, is regal.
I don't need documentation. The code is obvious to me. OK, but is it to the next programmer?
Evil olive.
I never thought computer science could be such fun!
Sex at noon taxes.
You expect me to read ten chapters in two days? No, I expect you to read ten chapters over the semester.
Never odd or even.

In which case the code should be:

#include <iostream>
int main ()
{
std::cout<< "Vanna, wanna V?zn";
std::cout<< "\nMust sell at tallest sum.\n";
std::cout<< "\nI should get an eighty. Why? Because I get an eighty in all my other classes.\n";
std::cout<< "\nLager, Sir, is regal.\n";
std::cout<< "\nI dont need documentation. The code is obvious to me. OK, but is it to the next programmer?\n";
std::cout<< "\nEvil Olive\n";
std::cout<< "\nI never thought computer science could be such fun!\n";
std::cout<< "\nSex at noo taxes.";
std::cout<< "\nYou expect me to read ten chapters in two days? No, I expect you to read ten chapters over the semester.\n";
std::cout<< "\nNever odd or even.\n";
std::cin.get ();
return 0;
}

Try that. I did this using CMD (command prompt). Compile this and see if what you wanted. If its ok, click solved thread so others know its done! (=

Ok so after doing some quick checks it doesn't look like my temp is actually storing the characters as lower case. This explains why the first sentence works, because it begins and ends with a capital letter.

So I just need to figure out how to actually get my temp string to be lower case...