How do you output the \ symbol using cout?

前端 未结 7 774
误落风尘
误落风尘 2020-12-10 05:32

How do you output \\ symbol using cout?

相关标签:
7条回答
  • 2020-12-10 06:26

    Since C++11 you can also use raw string literals.

    std::cout << R"(There is no need to escape backslash here \)";
    

    Escape characters (like \n \t or " ) are not processed in the raw string literals.

    0 讨论(0)
提交回复
热议问题