Ok I seem to have all the loops in place and somewhat working
and I found in other threads good info on actually checking to see if its a palindrome. But what is wrong with this loop?
while(infile) //files already open and I have two arrays, input,test
{
infile.getline(input,MAX) // MAX=50
for(int index=0;index<MAX;index++)
input[index]=tolower(input[index]; // to lower case
for(int index2=0;index2<MAX;index2++)
{
if(isalpha(input[index2])) // checks if its a letter
{
test[counter]=input[index2];
counter ++;
}
}
My thinking on the if statement is it will check input[0] and if its a letter it will assign test counter[0] to the letter in input[0] and if its not it should fall through and go to input[1].
OK heres the problem if I run A@bbA through it , it outputs
abbabba
I think its something to do with if statement ??
Thanks for the help