#include <iostream>
#include <fcntl.h>
#include <io.h>
int main() {
_setmode(_fileno(stdout), _O_U16TEXT);
std::wcout << L"Hello, this is a Unicode text!" << std::endl;
return 0;
}
#include <iostream>
: Includes the input/output stream header file for standard input/output operations.#include <fcntl.h>
: Includes the file control header file, which contains definitions for file control operations.#include <io.h>
: Includes the input/output header file, providing declarations for input/output functions.int main() { ... }
: Defines the main function, the entry point of the program._setmode(_fileno(stdout), _O_U16TEXT);
: Sets the output mode to output Unicode text by changing the mode of the standard output stream to _O_U16TEXT
.std::wcout << L"Hello, this is a Unicode text!" << std::endl;
: Outputs a Unicode string using wide characters to the console.return 0;
: Indicates successful termination of the program.