#include #include #include char *toLower(char *str); int main(void) { char str[]="HELLO, WORLD"; char *strp; printf("Before toLower (%s)\n", str); strp = toLower(str); printf("After toLower (%s)\n", strp); return 0; } char *toLower(char *str) { char *retp, *retp0; retp = (char *)malloc(strlen(str)); retp0 = &retp[0]; for ( ; *str ; *retp++, *str++){ *retp = *str; if ( 'A' <= *str && *str <= 'Z' ) *retp += 0x20; } return retp0; }