Изменение регистра

Простые типы / Строки

char str[] = "Lower And Upper";
char lower[sizeof str];
char upper[sizeof str];
char swapCase[sizeof str];

//letter by letter, the terminating zero is copied too;
//ctype functions need an unsigned char and know only ASCII letters
for (size_t i = 0; i < sizeof str; i++) {
    unsigned char c = str[i];
    lower[i] = tolower(c);
    upper[i] = toupper(c);
    swapCase[i] = isupper(c) ? tolower(c) : toupper(c);
}
//lower is "lower and upper"
//upper is "LOWER AND UPPER"
//swapCase is "lOWER aND uPPER"

printf("lower is %s\n", lower);
printf("upper is %s\n", upper);
printf("swapCase is %s\n", swapCase);