Categories
How can I make it possible to output string literals?
For example:
#include <string> string s = "\n" std::cout<<s<<std::endl;
Answer the question
In order to leave comments, you need to log in
And the output should be : \n How to do that ?
int main() { std::string s = "\\n"; std::cout << s << std::endl; }
int main() { auto s = R"(Raw string literal\n)"; std::cout << s << std::endl; }
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question