Skip to content

Instantly share code, notes, and snippets.

@Stealthii
Created August 14, 2013 00:38
Show Gist options
  • Save Stealthii/6227041 to your computer and use it in GitHub Desktop.
Save Stealthii/6227041 to your computer and use it in GitHub Desktop.
Palindrome work
#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