国内某大公司的笔试试题,哪位大侠有更好的写法? 编写一个函数,查找字符串中的子串并替换为另外一个字符串;void Replace(CString &strAll,CString strSub,CString strRep){} 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 void Replace(CString &strAll,CString strSub,CString strRep){ int iPos = strAll.Find(strSub); if(iPos == -1) return; CString strLeft = strAll.Left(iPos); CString strRight = strAll.Mid(iPos+strSub.GetLength()); Replace(strRight,strSub,strRep); strAll = strLeft + strRep + strRight;} 请问\350\257\267\346\202\250\这是种什么形式的编码? 判断计算机是否掉线 用Winexec打开程序和手动双击打开有什么区别? 做过工程的速来拿分~ 又麻烦大家了 请问在vc中怎样将DWORD类型转换为char类型 如何获取控件? 有什么封装好的类在view中显示图片的吗? 怎样理解这个指针呢int (*aa)[2]; 想做个串口通信程序,谁有这方面的例子呀,要求是异步方式的,最好是用API的! 大侠们:怎样使窗口标题栏上的关闭按钮处于不能操作状态 如何注册一个包含OCX及相关DLL的CAB?不要说从网页上下载啊。 请教:定义的这个宏实现了什么功能?谢谢!
{
int iPos = strAll.Find(strSub);
if(iPos == -1)
return;
CString strLeft = strAll.Left(iPos);
CString strRight = strAll.Mid(iPos+strSub.GetLength());
Replace(strRight,strSub,strRep);
strAll = strLeft + strRep + strRight;
}