Skip to content
how to put ascii art to c++
Profile icon
PhuPns

i write code
cout << R"(
_____ __ _____ _ _ ___ _ _ __ ___ _ __ __ _ ________
|_ /__\ | | || | | | | | |/| _ \ | | \ | | |/ / |
| || / | | | | >< | | | 'V' | / | v / || v | | | ' | _
| |
|
| _
/ || ||||| !/ _!_/||_|__/ ||_|_/ ||
) " << '\n';

but it error there are missing terminating character

You are viewing a single comment. View All
Profile icon
Bookie0

Hi,

you could do something like this:

#include <iostream> using namespace std; int main() { cout << " _____ __ _____ _ _ ___ _ _ __ ___ _ __ __ _ ________ " << endl; cout << " |_ _/__\ |_ _| || | __| | | | |/__\| _ \ | | _\ | \| |/ _/_ _| " << endl; cout << " | || \/ | | | | >< | _| | V | \/ | v / |_| v | | | | \__ | | " << endl; cout << "|_| \__/ |_| |_||_|___| !_/ \_!\__/|_|_\___|__/ |_|\__|\__/ |_| " << endl; }

Basically you're outputting each line, line by line.

Or on one line:

#include <iostream> using namespace std; int main() { cout << " _____ __ _____ _ _ ___ _ _ __ ___ _ __ __ _ ________ \n |_ _/__\ |_ _| || | __| | | | |/__\| _ \ | | _\ | \| |/ _/_ _| \n | || \/ | | | | >< | _| | V | \/ | v / |_| v | | | | \__ | | \n|_| \__/ |_| |_||_|___| !_/ \_!\__/|_|_\___|__/ |_|\__|\__/ |_| " << endl; }

We separate each line with \n.

However, you'll probably get warnings because there are a bunch of starting escape codes (\), so you might want to take them off, or replace them.

Good luck! ;)

Profile icon
Coder100

baf a raw string is literally meant so you don't have to do this

@Bookie0

Profile icon
Bookie0

ah huh didn't know about Raw strings lol

@Coder100

Profile icon
Coder100
Profile icon
PhuPns
Profile icon
Bookie0

np! Does it work?

@PhuPns

Profile icon
PhuPns
Profile icon
Bookie0

ok cool!

Remember to mark this answer as correct if it helped you! =)

@PhuPns