Displaying a text picture
Hello,
I'm going to make a game, and I'm having some trouble. I'm trying to cout a picture of a car... here is my script.
1 2 3 4 5 6 7 8 9 10 11
|
#include <iostream>
using namespace std;
int main(int argc, char *argv[]) {
cout<<" ___________"<<endl;
cout<<" // ||| \\"<<endl;
cout<<" __//____|||____\\____"<<endl;
cout<<"| _| | _ ||"<<endl;
cout<<"|/ \______|______/ \_||"<<endl;
cout<<"_\_/_____________\_/_______"<<endl;
}
|
Its coming out like(with warnings):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
Untitled.cpp:9:7: warning: unknown escape sequence '\_'
cout<<"|/ \______|______/ \_||"<<endl;
^
Untitled.cpp:9:7: warning: unknown escape sequence '\_'
Untitled.cpp:10:7: warning: unknown escape sequence '\_'
cout<<"_\_/_____________\_/_______"<<endl;
^
Untitled.cpp:10:7: warning: unknown escape sequence '\_'
4 warnings generated.
___________
// ||| \
__//____|||____\____
| _| | _ ||
|/ ______|______/ _||
__/______________/_______
|
Why is it demented?
Try replacing every \
with \\
. This should "escape" the backslashes.
Topic archived. No new replies allowed.