CString strZap("C--");
int n = strZap.Replace('-', '+');
这样可以CString strZap("d:\asd\asd\asd\asd\asd");
int n = strZap.Replace('\', '\\');
这个这样
F:\work\c++\fffffff\fffffffDlg.cpp(180) : error C2017: illegal escape sequence
F:\work\c++\fffffff\fffffffDlg.cpp(180) : error C2017: illegal escape sequence
F:\work\c++\fffffff\fffffffDlg.cpp(180) : error C2001: newline in constant
int n = strZap.Replace('-', '+');
这样可以CString strZap("d:\asd\asd\asd\asd\asd");
int n = strZap.Replace('\', '\\');
这个这样
F:\work\c++\fffffff\fffffffDlg.cpp(180) : error C2017: illegal escape sequence
F:\work\c++\fffffff\fffffffDlg.cpp(180) : error C2017: illegal escape sequence
F:\work\c++\fffffff\fffffffDlg.cpp(180) : error C2001: newline in constant
int n = strZap.Replace(_T('\\'), _T('\\\\'));
单杠\是转义符,双杠\\才表示字符(\)
改成:CString strZap("d:\\asd\\asd\\asd\\asd\\asd");
int n = strZap.Replace('\\', '\\\\');
-------------------------------------
???
if(dlg.DoModal()==IDOK)
{
CString FilePathName;
FilePathName=dlg.GetPathName();
}
}
c++中有吗