Reputation: 59
I am trying to make a graphic in C++ that basically is a smiley face:
"_____/"
But when I build my program, the use of "\" character gives me an error "unknown escape sequence"
Any thoughts? I am going to print the smiley face by printing some special characters.
Upvotes: 0
Views: 107
Reputation: 8427
You can also use raw string literals in C++11 that is more convenient:
std::cout << "The output is: " << R"(\_________/)" << std::endl;
that prints for you something like this:
The output is: \_________/
Upvotes: 0
Reputation: 184
Use "\\" . The backslash is a string command
"\\" --> \
"\n" --> new line
"\t" --> tab
etc..
See full list here https://msdn.microsoft.com/en-us/library/6aw8xdf2.aspx
Upvotes: 1