CString str6; CString str7; CString strToken; CString x[2]; int length=0; int nTokenPos = 0; int xcounter=0; m_status.Open("E:\\3.txt",CStdioFile::modeReadWrite); //open file while(m_status.ReadString(str6)) { length++; //get the number of line in file } m_status.SeekToBegin(); for(int i=0;i<length;i++) { m_status.ReadString(str6); str7 = str6; strToken = str7.Tokenize(_T(" "),nTokenPos); //each word between spaces save in //strToken while (!strToken.IsEmpty()) { x[xcounter] = strToken; //save each word in array xcounter++; strToken = str7.Tokenize(_T(" "), nTokenPos); } if (x[1]==m_Number) { x[2]=m_Name; //here I want if number in file was same as number in editBox1 so change //the name in file to name in editbox2 } } m_status.Close(); UpdateData(FALSE);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)