/* ** hw11.c ** sample solution programs for hw#11 ** -- written by Jeff Tian, 4/28/99. */ #include #include #include #define MaxN 10 #define nNames 5 #define lenName 20 void SortStr(char strings[nNames][lenName]); main() { int i; char Names[nNames][lenName] = { "Ada", "Jeff", "Madam, I'm Adam.", "CSE 1341", "Section 801" }; printf("================================================\n"); printf("String palindrome (1=palindrome/0=not palindrome)\n"); printf("================================================\n"); for (i=0; i 0 && !isalpha(tailchar = string[--tail])); while(result && head < tail ) { if (toupper(headchar) != toupper(tailchar)) { result = 0; } else { while (head < n && !isalpha(headchar = string[++head])); while (tail > 0 && !isalpha(tailchar = string[--tail])); } } return result; }