Created
August 14, 2013 00:38
-
-
Save Stealthii/6227041 to your computer and use it in GitHub Desktop.
Palindrome work
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
bool is_palindrome(char * word) { | |
char *p, *t; | |
for (p=word; *p!='\0'; p++); | |
for (t=word; p--; p>=t) { | |
if (*p==*t) { | |
t++; | |
p--; | |
} | |
else | |
break; | |
} | |
if (t>p) | |
return(true); | |
else | |
return(false); | |
} | |
void main(void) { | |
char * dan = "KAYAK\0"; | |
char[6] claire = ['K','A','Y','A','K','\0']; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment