64,654
社区成员
发帖
与我相关
我的任务
分享
//---需要将路径中的\编程\\--------------
string strTemp="D:\fdahkf\123.txt";
size_t index=0;
while(index!=string::npos)
{
index=strTemp.find("\\",index);//这个string他认死理啊 他才不管什么转义不转义
if(index!=string::npos)
strTemp.replace(index,1,"\\");
}