Define std::string in C++ without escape characters

后端 未结 3 721
星月不相逢
星月不相逢 2020-12-06 10:43

What would be the most painless way to input un-escaped characters sequence to std::string?

Instead of

 std::string st = \"C:\\\\program         


        
3条回答
  •  既然无缘
    2020-12-06 10:58

    C & C++ only supports using \ to escape strings, and you have to use it. If you have a bunch of paths to work with, I'd suggest opening them in an editor and doing a bulk replacement of \ with \\.

提交回复
热议问题