1 #include<stdio.h> 2 #include<string.h> 3 int main() 4 { 5 6 char str[] = "aad9idaa"; 7 char * p = str; 8 char *q = p+strlen(str)-1; 9 10 while( (q-p)>0){ 11 12 if( *p != *q){ 13 14 printf("is not 1:%c, 2: %c\n", *p,*q); 15 return 1; 16 } 17 p++; 18 q--; 19 20 } 21 22 printf("yes \n"); 23 24 return 0; 25 }