write a function to find whether a string is palindrome or
not and how many palindrome this string contain?
Answer Posted / nm
bool palindrome(char *str){
char *ptr1 = str;
char *ptr2 = str + strlen(str) - 1;
while(ptr1 < ptr2){
if(*ptr1 != *ptr2)
return false;
ptr1++;
ptr2--;
}
return true;
}
| Is This Answer Correct ? | 30 Yes | 29 No |
Post New Answer View All Answers
What are the c keywords?
What does the c in ctime mean?
what is different between auto and local static? why should we use local static?
What is #line in c?
Where are some collections of useful code fragments and examples?
Is c call by value?
Write a program to check armstrong number in c?
Explain is it better to bitshift a value than to multiply by 2?
How do you search data in a data file using random access method?
How can you determine the size of an allocated portion of memory?
How do I get an accurate error status return from system on ms-dos?
What is unsigned int in c?
Why c language is called c?
How can I remove the trailing spaces from a string?
What is string length in c?