小编Nat*_*Fox的帖子

使用 printf 在控制台中使用 C++ unicode 字符?

我的代码:

\n\n
#include <iostream>\n#include <windows.h>\n\nusing namespace std;\n\nint pos[9];\n\nint main() {\n    printf(" %c \xe2\x95\x91 %c \xe2\x95\x91 %c ", pos[0], pos[1], pos[2]);\n    printf("\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\xac\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\xac\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90");\n    printf(" %c \xe2\x95\x91 %c \xe2\x95\x91 %c "), pos[3], pos[4], pos[5];\n    printf("\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\xac\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\xac\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90");\n    printf(" %c \xe2\x95\x91 %c \xe2\x95\x91 %c "), pos[6], pos[7], pos[8];\n    system("pause");\n}\n
Run Code Online (Sandbox Code Playgroud)\n\n

我的控制台输出:

\n\n

安慰

\n\n

我知道还有其他方法可以做到这一点,但重点是使用 printf 来实现这一点:| 有任何想法吗?

\n

c++ windows unicode windows-console

2
推荐指数
1
解决办法
2397
查看次数

标签 统计

c++ ×1

unicode ×1

windows ×1

windows-console ×1