猫史档案馆


啊啊啊加急!!!

用户:口阿米讠若其斤口阿米讠若其斤查看:2 回复:3 评论:2 创建时间:2024-07-06T12:11:48


toupper怎么用??(C++)


回复

上一页1 页 / 共 1下一页
sltox⁧~喵⁧sltox⁧~喵⁧

int topper(char c(实际上是被转化成了int x字符编码));

putchar (topper(char x));

在<ctype.h>里面

点赞0


评论


sltox⁧~喵⁧sltox⁧~喵⁧

#include <iostream>
#include <ctype.h>
using namespace std;
int main(){
    char str[] = "take our /usr";
    for(int i = 0;str[i];i++){
        str[i] = toupper(str[i]);
    }
    cout<<str;
    return 0;
}

点赞0


评论


sltox⁧~喵⁧sltox⁧~喵⁧

putchar()可以,cout也可以,可以直接给字符数组赋值

点赞0


评论