I think the problem is that you're couting palindromes, which is a boolean. In a console application, this will be output as 1 for true and 0 for false. since your cout<<palindromes is in a if(palindromes) conditional, it is always giving you ones.
I think what you want is cout << line[counter].
I hope this helps, I believe I understood what your program is supposed to do.