#include #include #include /* for tolower: KR pp. 166, 248-249; King p. 528 */ #define N 256 /* maximum word length */ void lower(char *p); int main() { char a[N]; printf("Please type a word and press RETURN.\n"); scanf("%s", a); lower(a); printf("The word in all lowercase is %s.\n", a); return EXIT_SUCCESS; } /* Change the string to all lowercase. */ #if 0 void lower(char *string) { char *p; for (p = string; *p != '\0'; ++p) { *p = tolower(*p); } } #endif void lower(char *p) { if (*p != '\0') { *p = tolower(*p); lower(p + 1); } }