I want to print art ASCII words (pixel words) like these on Console:
███████╗███╗ ██╗ █████╗ ██╗ ██╗███████╗
██╔════╝████╗ ██║██╔══██╗██║ ██╔╝██╔════╝
███████╗██╔██╗ ██║███████║█████╔╝ █████╗
╚════██║██║╚██╗██║██╔══██║██╔═██╗ ██╔══╝
███████║██║ ╚████║██║ ██║██║ ██╗███████╗
╚══════╝╚═╝ ╚═══╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝
My idea is reading from a file .txt then print it, but it is not effective. It prints like these:
ûêΓûêΓûêΓûêΓûêΓûêΓûêΓòùΓûêΓûêΓûêΓòù ΓûêΓûêΓòù ΓûêΓûêΓûêΓûêΓûêΓòù ΓûêΓûêΓòù ΓûêΓûêΓòùΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓòù
ΓûêΓûêΓòöΓòÉΓòÉΓòÉΓòÉΓò¥ΓûêΓûêΓûêΓûêΓòù ΓûêΓûêΓòæΓûêΓûêΓòöΓòÉΓòÉΓûêΓûêΓ
So what should I do to solve?
I read a question (Read and print special ascii characters from file in c) from 3 years ago, but it’s also not effective.
This is source:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
void displayFile(const string &fileName)
{
ifstream file(fileName);
string line;
if (file.is_open())
{
while (getline(file, line))
{
cout << line << endl;
}
file.close();
}
else
{
cout << "File is not open";
}
}
int main()
{
displayFile("logo.txt");
return 0;
}
New contributor
Nguyễn Hoàng Hải is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
4