1. 程式人生 > >C++擷取字串

C++擷取字串

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());