16,471
社区成员
发帖
与我相关
我的任务
分享
CFile file;
CString str;
CString str_temp;
int iIndex=1;
file.Open("Salvos/123.txt",CFile::modeReadWrite);
file.Read(str.GetBuffer(file.GetLength()),file.GetLength());//0
while(iIndex)
{
//char str_type,str_output,str_input;
int n=str.Find(";");//1
str_temp=str.Left(n);//2
。。。
。。。
#include <afxwin.h>
#include <iostream>
int main()
{
CString str("90:1:6;90:2:6;90:3:2;90:4:6;90:5:5;90:6:2;");
std::cout << (LPCTSTR)str << std::endl << std::endl;
int n=str.Find(";");//1
CString str_temp=str.Left(n);//2
std::cout << (LPCTSTR)str_temp << std::endl;
}
// int n=str.Find(";") 不是传字符串";"
int n = str.Find(';'); // 是传字符';'