Please use code blocks when you post code. You've been around long enough now to know about them. It makes code easier to read by preserving the formatting and using a fixed pitch font.

Rather than me reading the code and trying to figure out if it's correct or not, why don't you plug it into your favourite compiler, write some test data and see what the program does with that data. If it picks out the right data and ignores the wrong, then it works. If it doesn't, then it doesn't.

If you display the contents of temp just before returning from PalindromeChecker(), passing in some known words, does temp contain what you expect?