Как написать текст символами в консоль Visual Studio?

301
31 мая 2022, 12:40

Язык программирования с++. Нужно вставить надпись

        cout << "███████████████████████████████████" << endl; 
        cout << "█─███─█───█─███────█────█─███─█───█" << endl;
        cout << "█─███─█─███─███─██─█─██─█──█──█─███" << endl;
        cout << "█─█─█─█───█─███─████─██─█─█─█─█───█" << endl;
        cout << "█─────█─███─███─██─█─██─█─███─█─███" << endl;
        cout << "██─█─██───█───█────█────█─███─█───█" << endl;
        cout << "███████████████████████████████████" << endl;
        cout << "██████████" << endl;
        cout << "█───█────█" << endl;
        cout << "██─██─██─█" << endl;
        cout << "██─██─██─█" << endl;
        cout << "██─██─██─█" << endl;
        cout << "██─██────█" << endl;
        cout << "██████████" << endl;
        cout << "██████████████" << endl;
        cout << "█───█─██─█───█" << endl;
        cout << "██─██─██─█─███" << endl;
        cout << "██─██────█───█" << endl;
        cout << "██─██─██─█─███" << endl;
        cout << "██─██─██─█───█" << endl;
        cout << "██████████████" << endl;
        cout << "█████████████████████" << endl;
        cout << "█────█────█─███─█───█" << endl;
        cout << "█─████─██─█──█──█─███" << endl;
        cout << "█─█──█────█─█─█─█───█" << endl;
        cout << "█─██─█─██─█─███─█─███" << endl;
        cout << "█────█─██─█─███─█───█" << endl;
        cout << "█████████████████████" << endl;
Answer 1

Можно отображать и в UTF-8 (cp65001), но с этой кодировкой обычно больше проблем. Проще выводить в UTF-16, в этом случае не придется дополнительно возиться с кодировкой файлов и консоли, только поставить режим вывода стандартного потока:

#include <iostream>
#include <io.h>
#include <fcntl.h>
#include <stdio.h>
int main()
{
    ::_setmode(::_fileno(stdout), _O_U16TEXT);
    auto const & sz_message
    {
        L"███████████████████████████████████" L"\n"
        L"█─███─█───█─███────█────█─███─█───█" L"\n"
        L"█─███─█─███─███─██─█─██─█──█──█─███" L"\n"
        L"█─█─█─█───█─███─████─██─█─█─█─█───█" L"\n"
        L"█─────█─███─███─██─█─██─█─███─█─███" L"\n"
        L"██─█─██───█───█────█────█─███─█───█" L"\n"
        L"███████████████████████████████████" L"\n"
    };
    ::std::wcout << sz_message << ::std::flush;
    ::_wsystem(L"pause");
    return(0);
}

С пиксельным шрифтом 8х12 (в этом случае еще не будет антиалиасинга и разрывов между строками):

READ ALSO
Ошибка [ilink64 Error] Error: Unresolved external в C++ Builder 10.3

Ошибка [ilink64 Error] Error: Unresolved external в C++ Builder 10.3

Начал изучать C++ Builder 103 и сразу столкнулся с непонятной ошибкой

180
C++ парсинг строки на числа

C++ парсинг строки на числа

Друзья! Подскажите, пожалуйста, наиболее элегантный способ следзадачи:

145
Fatal error: Uncaught Error: Call to undefined function mysql_connect()

Fatal error: Uncaught Error: Call to undefined function mysql_connect()

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:\Users\user\Desktop\open\OpenServer\domains\lazarua\index

245
использование mongo в php на windows

использование mongo в php на windows

Не может найти класс MongoDB\Driver\Manager

243