c-Printf显示�每当我使用扩展ascii(无符号字符)时



我想使用一些扩展的ASCII字符,我使用了无符号字符。没有编译器错误,但它只显示�

#include <stdio.h>
#include <wchar.h>
#include "PrintColor.h"
unsigned char background_occupacy[101] = {178,178,177,'@','@','@','@','W','W','M','M','M','M','M','M','M','M','B','Q','G','P','N','N','&','O','D','g','S','E','m','w','A','8','Z','K','H','6','9','X','C','p','b','q','5','U','2','O','e','3','a','V','V','F','4','h','k','o','s','y','u','n','n','c','T','z','z','7','J','x','L','L','v','?','?','=','f','t','t','j',')','(','(','r','r','i','^','/','*','_',';',';',':','-',',','.','.',' ',' ',' ',' '};
int main(){
text_color(5);
background_color(5);
for(int j = 0; j < 8; j ++){
text_color(8 - j);
background_color(j);
for(int i = 101; i > -1; i --){
printf("%c",background_occupacy[i]);
}
text_color(j);
background_color(8 - j);
for(int i = 0; i < 101; i ++){
printf("%c",background_occupacy[i]);
}
reset();
printf("n");
}
}

我认为可能存在一些问题,比如:你的终端有自己的编码,所以如果你想输出";特别的";chars-确保您的终端可以输出它。

因此,如果您是Windows用户,请更改代码页或使用转换为其他编码。如果您不是windows用户,请尝试使用此库:https://github.com/fmtlib/fmt


相关内容

  • 没有找到相关文章

最新更新