Skip to content
← Back to Community
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

Voters
Profile icon
JakeJohnson18
Profile icon
PhuPns
Comments
hotnewtop
Profile icon
Coder100

that's strange. Did you maybe insert an extra ?

#include <iostream> int main() { std::cout << R"( _____ __ _____ _ _ ___ _ _ __ ___ _ __ __ _ ________ |_ _/__\ |_ _| || | __| | | | |/__\| _ \ | | _\ | \| |/ _/_ _| | || \/ | | | | >< | _| | 'V' | \/ | v / |_| v | | | ' | \__ | | |_| \__/ |_| |_||_|___| !_/ \_!\__/|_|_\___|__/ |_|\__|\__/ |_| )" << std::endl; }
Profile icon
PhuPns

thank! but i try to do this is error that show are missing terminating character

@Coder100

Profile icon
Coder100

@PhuPns
oh did my solution not work either? Sorry about that

Profile icon
Coder100

hmm it is working for me

@PhuPns

Profile icon
PhuPns

i can't run the [email protected]

Profile icon
Coder100

why not?

@PhuPns

Profile icon
Coder100

send repl

@PhuPns

Profile icon
PhuPns
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

Profile icon
RYANTADIPARTHI

it's because you have to use separate court << lines for it. Not just one. it has to be like cout <<
cout <<
cout << ... and so forth

Profile icon
Bookie0

its cout <<, not cout >>. It would be cin >>

@RYANTADIPARTHI

Profile icon
RYANTADIPARTHI

@Bookie0
yeah, thanks for reminding me, i'll change that.

Profile icon
Bookie0

cool np! :)

@RYANTADIPARTHI

Profile icon
Coder100

noo you don't reee that's a raw string no downgrading >:(

@RYANTADIPARTHI