[C]toupper, tolower

#include <stdio.h>
#include <ctype.h>

void upper(char *x) {
    while (*x != '\0') {
        *x = toupper(*x);
        x++;
    }
}

int main() {
    char s[] = "De poca estabilidad o duración";
    upper(s);
    printf("%s\n", s);
    return 0;
}

//只能转换英文26个字母, 西语中的ó都无法转换
// DE POCA ESTABILIDAD O DURACIóN

猜你喜欢

转载自www.cnblogs.com/profesor/p/13167415.html