1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#include <stdio.h> #include <ctype.h> void my_strcpy(char *t, char *s) { while (*t++ = *s++) ; } void main() { char a[30]; char *b; char c[30]; printf("input string > "); fgets(a, 30, stdin); b = a; my_strcpy(c, a); for (int i = 0; a[i]; i++) a[i] = toupper(a[i]); printf("a: %sb: %sc: %s", a, b, c); }