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
Why is sprintf unsafe?
What is a far pointer in c?
Can a program have two main functions?
Why do we use int main instead of void main in c?
What is an operator?
What is the use of typedef in structure in c?
please give me some tips for the placement in the TCS.
What is null pointer constant?
What is a string?
How can type-insensitive macros be created?
GIVEN A FLOATING POINT NUMBER HOW IS IT ACTUALLY STORED IN MEMORY ? CAN ANYONE EXPLAIN?? THE 32 BIT REPRESENTATION OF A FLOATING POINT NUMBER ALLOTS: 1 BIT-SIGN 8 BITS-EXPONENT 23 BITS-MANTISSA
What was noalias and what ever happened to it?
Explain what are its uses in c programming?
Explain b+ tree?
Is c programming hard?