Cracking Interviews Exposed
Saturday, January 19, 2008
Find out if a string is a palindrome?
bool Palindrome(char *str)
{
int end = strlen(str)-1;
for (int i = 0; i <>
if (*(str+i) != *(str+end))
return false;
return true;
}
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment