Good night;
can you see this function ;
its true
but the only error is :
missing ';' before 'return'
missing ';' before '}'
missing ';' before '}'
missing ';' before '{'
missing function header (old-style formal list?)
but there is no ; missing , i checked it twice
this is my function (for checking if word is Palindrome-madam-. or not by push half of the word in a stack and then compare it with the other half of the word) :
template <class Type>
int isPalindrome (Type * word)
{ stackType <Type> mystack;
int i=0,count=0;
while(word[i]!=NULL)
{
count++;
i++;
}
int half=count/2;
for(int j=0;j<half;j++)
{ mystack.push(word[j]);}
if(count%2==1)//............... Odd No.
{
j=j+2;
while(word[j]!=NULL)
{
if(word[j]==mystack.top())
{mystack.pop();
j++;
}
else
{ return 0;}
}
}
else //.................Even No.;
{ j++;
while(word[j]!=NULL)
{ if (word[j]==mystack.top())
{ mystack.pop();
j++;
}
else
{ return 0 ;}
}
}
}
return 1;
}