char m_sFilePath[20];
m_sFilePath = "123456789";
Cstring m_sFilePathSave;
m_sFilePathSave = m_sFilePath;
m_sFilePathSave = m_sFilePathSave.Left(m_sFilePathSave.GetLength()-1);//取左边8位元素,则m_sFilePathSave="12345678"
string tempPath(g_CameraSet.CamPicCar);
string picPath = "";
int index = 0;
index = tempPath.find(".");
picPath += tempPath.substr(0,index) + "_result.jpg";
char picName[500];
memset(picName,0,sizeof(picName));
strcpy(picName,picPath.c_str());
C++截取字符串
最新推荐文章于 2024-06-20 17:14:51 发布