用更多关于我要求的知识重写这个问题;(感谢James Risner和Turtle的帮助,但我的措辞不正确,得到了与所需不同的回复(
我目前正在为我的类编写一个程序,在这个程序中,我在字符串中打印出非标准的Unicode字符。这些字符是网站上的直接副本,不是u\####标准副本,而是预先选择的unicode字符。我正在运行的程序是Clion,使用mingw的忍者构建设置构建我的程序
我遇到的问题是,我的输出,而不是unicode字符,而是(我认为(不相关字符的随机数组。在Clion的"调试"菜单中打印它会输出正确的输出,但在运行时或其自己的外部文件中打印它都会输出问题。以下是我的代码的精确副本(逐字符(请不要重复使用:(
#include <iostream>
#include <string>
#include <windows.h>
#define _WIN32_WINNT 0x0500
#include <thread>
#include <chrono>
#include <random>
using namespace std;
static int Range(int start, int end){
random_device rd;
mt19937 rng(rd());
uniform_int_distribution<int> dist(start,end);
return dist(rng);
}
int main() {
system("color 0F");
HWND consoleWindow = GetConsoleWindow();
int windowSize = 390;
MoveWindow(consoleWindow, windowSize,windowSize,windowSize,windowSize, TRUE); // This program and the one below it not only locks the window size, but also locks the window at a fixed display pixel length/width
SetWindowLong(consoleWindow, GWL_STYLE, GetWindowLong(consoleWindow, GWL_STYLE) & ~WS_MAXIMIZEBOX & ~WS_SIZEBOX);
ShowScrollBar(GetConsoleWindow(), SB_VERT, 0);
string name = "