Mar*_* A. 5 c++ visual-studio visual-studio-templates
我有一个类似的VS模板
string mypath = "C:\\custom\\file.jpg";
Run Code Online (Sandbox Code Playgroud)
我想用模板替换参数$ userpath $创建C:\ custom\part.有什么办法可以避免使用双斜线吗?
我想写的是:
string mypath = SOMETHING("C:\custom\file.jpg")
Run Code Online (Sandbox Code Playgroud)
不会使用\ c和\ f进行转义并形成有效路径.可能吗?
对于路径,您应该能够使用单个正斜杠作为分隔符:
std::string mypath = "c:/custom/file.jpg";
Run Code Online (Sandbox Code Playgroud)