char s1[] = "Upper/LOWER."; char s2[] = "MIXeD CaSe.."; /* exchanges s1,s2; and upcase of s1 */ dostr (ptr1,ptr2) char *ptr1,*ptr2; { unsigned char c, tmp; while (*ptr1 != 0) { tmp = *ptr2; c = *ptr1; if (c > 0x2F) { /* make sure it is not a special char */ *ptr2 = c & 0xDF; /* upcase case of s1 */ } else { /* leave special chars alone */ *ptr2 = c; } *ptr1 = tmp; ptr1++;ptr2++; } } main() { char c; printf("Before...\n"); printf("s1: '%s'\n",s1); printf("s2: '%s'\n",s2); dostr(s1,s2); printf("After...\n"); printf("s1: '%s'\n",s1); printf("s2: '%s'\n",s2); }