[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

 

posted @ 2020-06-20 08:10  profesor  阅读(133)  评论(0编辑  收藏  举报